mirror of
https://codeberg.org/scip/epuppy.git
synced 2025-12-16 12:01:00 +01:00
- Use antchfx/xmlquery for easier XML parsing. No more regexp wrangling and the result is much more reliable over a variety of ebooks. Much good. - fix chapter selection, look for `<?xml[...]` which is much more reliable - add option `-x` to dump the XML ebook source for debugging
25 lines
332 B
Go
25 lines
332 B
Go
package epub
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestEpub(t *testing.T) {
|
|
_, err := open(t, "test.epub")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func open(t *testing.T, f string) (*Book, error) {
|
|
bk, err := Open(f, false)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
t.Logf("files: %+v", bk.Files())
|
|
t.Logf("book: %+v", bk)
|
|
|
|
return bk, nil
|
|
}
|