From 5cdac2607dcb2ad66e7e9aba3521948669724cda Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Mon, 22 Jan 2018 09:55:41 -0500 Subject: 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. --- test/Tests/Writers/Powerpoint.hs | 8 +------- 1 file changed, 1 insertion(+), 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) -------------------------------------------------------------- -- cgit v1.2.3