aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-07-31 11:04:40 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-07-31 11:05:35 -0700
commit00662faefbca0b9889d3d79dbb2985350356d18a (patch)
treeb0f6c39c3c91bc247c970297b4afa5a630d6d410 /tests/Tests
parent6e96f8b4783d46e2b9e245bf3144f023c5296a38 (diff)
downloadpandoc-00662faefbca0b9889d3d79dbb2985350356d18a.tar.gz
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`
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Readers/Docx.hs5
1 files changed, 3 insertions, 2 deletions
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