@@ -44,10 +44,42 @@ featuresBag = [("img/check.gif","image/gif",1340)
44 ,("img/multiscripts_and_greek_alphabet.png","image/png",10060)
44 ,("img/multiscripts_and_greek_alphabet.png","image/png",10060)
47+-- with additional meta tag for cover in EPUB2 format
48+epub3CoverBag :: [(String, String, Int)]
49+epub3CoverBag = [("wasteland-cover.jpg","image/jpeg",103477)]
51+epub3NoCoverBag :: [(String, String, Int)]
52+epub3NoCoverBag = [("img/check.gif","image/gif",1340)
53+ ,("img/check.jpg","image/jpeg",2661)
54+ ,("img/check.png","image/png",2815)
57+-- content.opf uses the word `picture` to refer to the cover as much as validly possible
58+-- to check if references are resolved correctly
59+epub2PictureBag :: [(String, String, Int)]
60+epub2PictureBag = [("image/image.jpg","image/jpeg",9713)]
62+-- content.opf contains the word `cover` as much as possible, to check if possible multiple matches cause errors
63+epub2CoverBag :: [(String, String, Int)]
64+epub2CoverBag = [("image/cover.jpg","image/jpeg",9713)]
66+epub2NoCoverBag :: [(String, String, Int)]
47tests :: [TestTree]
69tests :: [TestTree]
49 [ testGroup "EPUB Mediabag"
71 [ testGroup "EPUB Mediabag"
50 [ testCase "features bag"
72 [ testCase "features bag"
51− (testMediaBag "epub/img.epub" featuresBag)
73+ (testMediaBag "epub/img.epub" featuresBag),
74+ testCase "EPUB3 cover bag"
75+ (testMediaBag "epub/wasteland.epub" epub3CoverBag),
76+ testCase "EPUB3 no cover bag"
77+ (testMediaBag "epub/img_no_cover.epub" epub3NoCoverBag),
78+ testCase "EPUB2 picture bag"
79+ (testMediaBag "epub/epub2_picture.epub" epub2PictureBag),
80+ testCase "EPUB2 cover bag"
81+ (testMediaBag "epub/epub2_cover.epub" epub2CoverBag),
82+ testCase "EPUB2 no cover bag"
83+ (testMediaBag "epub/epub2_no_cover.epub" epub2NoCoverBag)