aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Readers/Docx.hs
diff options
context:
space:
mode:
authorschrieveslaach <schrieveslaach@online.de>2017-06-12 15:52:29 +0200
committerGitHub <noreply@github.com>2017-06-12 15:52:29 +0200
commit635f299b441e238ccd34e3ad61c5e36f0ca30067 (patch)
tree11cfc34402975bad208f9a48d075fe2ace959e70 /test/Tests/Readers/Docx.hs
parent181c56d4003aa83abed23b95a452c4890aa3797c (diff)
parent23f3c2d7b4796d1af742a74999ce67924bf2abb3 (diff)
downloadpandoc-635f299b441e238ccd34e3ad61c5e36f0ca30067.tar.gz
Merge branch 'master' into textcolor-support
Diffstat (limited to 'test/Tests/Readers/Docx.hs')
-rw-r--r--test/Tests/Readers/Docx.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs
index 028a4ff2f..e55c3529b 100644
--- a/test/Tests/Readers/Docx.hs
+++ b/test/Tests/Readers/Docx.hs
@@ -2,11 +2,14 @@ module Tests.Readers.Docx (tests) where
import Codec.Archive.Zip
import qualified Data.ByteString.Lazy as B
+import qualified Data.ByteString as BS
+import qualified Data.Text as T
import qualified Data.Map as M
import Test.Tasty
import Test.Tasty.HUnit
import Tests.Helpers
import Text.Pandoc
+import Text.Pandoc.UTF8 as UTF8
import qualified Text.Pandoc.Class as P
import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory)
import System.IO.Unsafe -- TODO temporary
@@ -25,7 +28,7 @@ defopts :: ReaderOptions
defopts = def{ readerExtensions = getDefaultExtensions "docx" }
instance ToString NoNormPandoc where
- toString d = purely (writeNative def{ writerTemplate = s }) $ toPandoc d
+ toString d = T.unpack $ purely (writeNative def{ writerTemplate = s }) $ toPandoc d
where s = case d of
NoNormPandoc (Pandoc (Meta m) _)
| M.null m -> Nothing
@@ -40,7 +43,7 @@ compareOutput :: ReaderOptions
-> IO (NoNormPandoc, NoNormPandoc)
compareOutput opts docxFile nativeFile = do
df <- B.readFile docxFile
- nf <- Prelude.readFile nativeFile
+ nf <- UTF8.toText <$> BS.readFile nativeFile
p <- runIOorExplode $ readDocx opts df
df' <- runIOorExplode $ readNative def nf
return $ (noNorm p, noNorm df')