diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-07-14 23:39:33 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-07-14 23:39:33 +0200 |
commit | 4e9e1bae7cdd3d5317ac4d57346215c34dfc7358 (patch) | |
tree | 755b2db3d7a30f55f4ab86b8f1b57ed875cdd701 /test | |
parent | df5a00990e6d7ee410544e1d6daabb0e102348d6 (diff) | |
download | pandoc-4e9e1bae7cdd3d5317ac4d57346215c34dfc7358.tar.gz |
Refactored compareOutput in docx writer test
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Writers/Docx.hs | 13 |
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 |