summaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-07-14 23:39:33 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-07-14 23:39:33 +0200
commit4e9e1bae7cdd3d5317ac4d57346215c34dfc7358 (patch)
tree755b2db3d7a30f55f4ab86b8f1b57ed875cdd701 /test/Tests
parentdf5a00990e6d7ee410544e1d6daabb0e102348d6 (diff)
Refactored compareOutput in docx writer test
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Writers/Docx.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/Tests/Writers/Docx.hs b/test/Tests/Writers/Docx.hs
index 215952893..fae41e9d4 100644
--- a/test/Tests/Writers/Docx.hs
+++ b/test/Tests/Writers/Docx.hs
@@ -19,16 +19,15 @@ compareOutput :: Options
-> FilePath
-> FilePath
-> IO (Pandoc, Pandoc)
-compareOutput opts nativeFileIn nativeFileOut = do
+compareOutput (wopts, ropts) nativeFileIn nativeFileOut = do
nf <- UTF8.toText <$> BS.readFile nativeFileIn
nf' <- UTF8.toText <$> BS.readFile nativeFileOut
- let wopts = fst opts
- df <- runIOorExplode $ do
- d <- readNative def nf
- writeDocx wopts{writerUserDataDir = Just (".." </> "data")} d
+ df <- runIOorExplode $
+ readNative def nf >>=
+ writeDocx wopts{writerUserDataDir = Just (".." </> "data")} >>=
+ readDocx ropts
df' <- runIOorExplode (readNative def nf')
- p <- runIOorExplode $ readDocx (snd opts) df
- return (p, df')
+ return (df, df')
testCompareWithOptsIO :: Options -> String -> FilePath -> FilePath -> IO TestTree
testCompareWithOptsIO opts name nativeFileIn nativeFileOut = do