From 00662faefbca0b9889d3d79dbb2985350356d18a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 31 Jul 2014 11:04:40 -0700 Subject: Made MediaBag a newtype, and added mime type information to media. Shared now exports functions for interacting with a MediaBag: - `emptyMediaBag` - `lookuMedia` - `insertMedia` - `mediaDirectory` - `extractMediaBag` --- tests/Tests/Readers/Docx.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/Tests/Readers') diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs index 494669fd5..0eae20e22 100644 --- a/tests/Tests/Readers/Docx.hs +++ b/tests/Tests/Readers/Docx.hs @@ -12,6 +12,7 @@ import qualified Data.ByteString.Base64 as B64 import Text.Pandoc.Readers.Docx import Text.Pandoc.Writers.Native (writeNative) import qualified Data.Map as M +import Text.Pandoc.Shared (lookupMedia) -- We define a wrapper around pandoc that doesn't normalize in the -- tests. Since we do our own normalization, we want to make sure @@ -60,8 +61,8 @@ testCompareMediaIO name docxFile mediaPath mediaFile = do df <- B.readFile docxFile mf <- B.readFile mediaFile let (_, mb) = readDocx def df - dBytes = case M.lookup mediaPath mb of - Just bs -> bs + dBytes = case lookupMedia mediaPath mb of + Just (_,bs) -> bs Nothing -> error "Media file not found" d64 = B8.unpack $ B64.encode $ BS.concat $ B.toChunks dBytes m64 = B8.unpack $ B64.encode $ BS.concat $ B.toChunks mf -- cgit v1.2.3