git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: Modify mediabag test accordingly.
a6eead7Jesse Rosenthal
tests/Tests/Readers/Docx.hs+1−2
@@ -13,7 +13,6 @@ import Text.Pandoc.Writers.Native (writeNative)
13import qualified Data.Map as M
13import qualified Data.Map as M
14import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory)
14import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory)
15import Codec.Archive.Zip
15import Codec.Archive.Zip
16−import System.FilePath (combine)
17
16
18-- We define a wrapper around pandoc that doesn't normalize in the
17-- We define a wrapper around pandoc that doesn't normalize in the
19-- tests. Since we do our own normalization, we want to make sure
18-- tests. Since we do our own normalization, we want to make sure
@@ -60,7 +59,7 @@ testCompare = testCompareWithOpts def
60getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
59getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
61getMedia archivePath mediaPath = do
60getMedia archivePath mediaPath = do
62 zf <- B.readFile archivePath >>= return . toArchive
61 zf <- B.readFile archivePath >>= return . toArchive
63− return $ findEntryByPath (combine "word" mediaPath) zf >>= (Just . fromEntry)
62+ return $ findEntryByPath ("word/" ++ mediaPath) zf >>= (Just . fromEntry)
64
63
65compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
64compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
66compareMediaPathIO mediaPath mediaBag docxPath = do
65compareMediaPathIO mediaPath mediaBag docxPath = do