aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2018-01-22 09:55:41 -0500
committerJesse Rosenthal <jrosenthal@jhu.edu>2018-01-22 09:55:41 -0500
commit5cdac2607dcb2ad66e7e9aba3521948669724cda (patch)
tree0692da79e82887e53d8098d4eafa9d4bfcfaef8a
parent0e48c216bcf89340b878421be389ae1d7035e168 (diff)
downloadpandoc-5cdac2607dcb2ad66e7e9aba3521948669724cda.tar.gz
Powerpoint writer tests: simplify updating function
We had previously re-read the native file and converted it to Powerpoint. But we have already done that in constructing the test archive. So now we just convert the archive back to a bytestring and write it to disk.
-rw-r--r--test/Tests/Writers/Powerpoint.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs
index a493746b7..a90d6193e 100644
--- a/test/Tests/Writers/Powerpoint.hs
+++ b/test/Tests/Writers/Powerpoint.hs
@@ -58,12 +58,6 @@ testArchive opts fp = do
bs <- runIOorExplode $ readNative def txt >>= writePowerpoint opts
return $ toArchive bs
-updateGoldenFile :: WriterOptions -> FilePath -> FilePath -> IO ()
-updateGoldenFile opts nativeFP goldenFP = do
- txt <- T.readFile nativeFP
- bs <- runIOorExplode $ readNative def txt >>= writePowerpoint opts
- BL.writeFile goldenFP bs
-
compareFileList :: FilePath -> Archive -> Archive -> Maybe String
compareFileList goldenFP goldenArch testArch =
let testFiles = filesInArchive testArch
@@ -184,7 +178,7 @@ pptxTest testName opts nativeFP goldenFP =
, compareAllMediaFiles goldenArch testArch
]
in return $ if null res then Nothing else Just $ unlines res)
- (\_ -> updateGoldenFile opts nativeFP goldenFP)
+ (\a -> BL.writeFile goldenFP $ fromArchive a)
--------------------------------------------------------------