diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Readers/EPUB.hs | 34 | ||||
-rw-r--r-- | test/epub/epub2_cover.epub | bin | 0 -> 17937 bytes | |||
-rw-r--r-- | test/epub/epub2_no_cover.epub | bin | 0 -> 9730 bytes | |||
-rw-r--r-- | test/epub/epub2_picture.epub | bin | 0 -> 17939 bytes | |||
-rw-r--r-- | test/epub/img_no_cover.epub | bin | 0 -> 50594 bytes |
5 files changed, 33 insertions, 1 deletions
diff --git a/test/Tests/Readers/EPUB.hs b/test/Tests/Readers/EPUB.hs index 82e63bb64..f917668ef 100644 --- a/test/Tests/Readers/EPUB.hs +++ b/test/Tests/Readers/EPUB.hs @@ -44,10 +44,42 @@ featuresBag = [("img/check.gif","image/gif",1340) ,("img/multiscripts_and_greek_alphabet.png","image/png",10060) ] +-- with additional meta tag for cover in EPUB2 format +epub3CoverBag :: [(String, String, Int)] +epub3CoverBag = [("wasteland-cover.jpg","image/jpeg",103477)] + +epub3NoCoverBag :: [(String, String, Int)] +epub3NoCoverBag = [("img/check.gif","image/gif",1340) + ,("img/check.jpg","image/jpeg",2661) + ,("img/check.png","image/png",2815) + ] + +-- content.opf uses the word `picture` to refer to the cover as much as validly possible +-- to check if references are resolved correctly +epub2PictureBag :: [(String, String, Int)] +epub2PictureBag = [("image/image.jpg","image/jpeg",9713)] + +-- content.opf contains the word `cover` as much as possible, to check if possible multiple matches cause errors +epub2CoverBag :: [(String, String, Int)] +epub2CoverBag = [("image/cover.jpg","image/jpeg",9713)] + +epub2NoCoverBag :: [(String, String, Int)] +epub2NoCoverBag = [] + tests :: [TestTree] tests = [ testGroup "EPUB Mediabag" [ testCase "features bag" - (testMediaBag "epub/img.epub" featuresBag) + (testMediaBag "epub/img.epub" featuresBag), + testCase "EPUB3 cover bag" + (testMediaBag "epub/wasteland.epub" epub3CoverBag), + testCase "EPUB3 no cover bag" + (testMediaBag "epub/img_no_cover.epub" epub3NoCoverBag), + testCase "EPUB2 picture bag" + (testMediaBag "epub/epub2_picture.epub" epub2PictureBag), + testCase "EPUB2 cover bag" + (testMediaBag "epub/epub2_cover.epub" epub2CoverBag), + testCase "EPUB2 no cover bag" + (testMediaBag "epub/epub2_no_cover.epub" epub2NoCoverBag) ] ] diff --git a/test/epub/epub2_cover.epub b/test/epub/epub2_cover.epub Binary files differnew file mode 100644 index 000000000..02f8ec1fb --- /dev/null +++ b/test/epub/epub2_cover.epub diff --git a/test/epub/epub2_no_cover.epub b/test/epub/epub2_no_cover.epub Binary files differnew file mode 100644 index 000000000..cd8e24b3f --- /dev/null +++ b/test/epub/epub2_no_cover.epub diff --git a/test/epub/epub2_picture.epub b/test/epub/epub2_picture.epub Binary files differnew file mode 100644 index 000000000..d19684ce2 --- /dev/null +++ b/test/epub/epub2_picture.epub diff --git a/test/epub/img_no_cover.epub b/test/epub/img_no_cover.epub Binary files differnew file mode 100644 index 000000000..d8028ff2e --- /dev/null +++ b/test/epub/img_no_cover.epub |