git.iko.soy/typeable/pandoc
on master help sign in
Powerpoint writer tests: simplify updating function
5cdac26Jesse Rosenthal
test/Tests/Writers/Powerpoint.hs+1−7
@@ -58,12 +58,6 @@ testArchive opts fp = do
58 bs <- runIOorExplode $ readNative def txt >>= writePowerpoint opts
58 bs <- runIOorExplode $ readNative def txt >>= writePowerpoint opts
59 return $ toArchive bs
59 return $ toArchive bs
60
60
61−updateGoldenFile :: WriterOptions -> FilePath -> FilePath -> IO ()
62−updateGoldenFile opts nativeFP goldenFP = do
63− txt <- T.readFile nativeFP
64− bs <- runIOorExplode $ readNative def txt >>= writePowerpoint opts
65− BL.writeFile goldenFP bs
66−
67compareFileList :: FilePath -> Archive -> Archive -> Maybe String
61compareFileList :: FilePath -> Archive -> Archive -> Maybe String
68compareFileList goldenFP goldenArch testArch =
62compareFileList goldenFP goldenArch testArch =
69 let testFiles = filesInArchive testArch
63 let testFiles = filesInArchive testArch
@@ -184,7 +178,7 @@ pptxTest testName opts nativeFP goldenFP =
184 , compareAllMediaFiles goldenArch testArch
178 , compareAllMediaFiles goldenArch testArch
185 ]
179 ]
186 in return $ if null res then Nothing else Just $ unlines res)
180 in return $ if null res then Nothing else Just $ unlines res)
187− (\_ -> updateGoldenFile opts nativeFP goldenFP)
181+ (\a -> BL.writeFile goldenFP $ fromArchive a)
188
182
189--------------------------------------------------------------
183--------------------------------------------------------------
190
184