git.iko.soy/typeable/pandoc
on master help sign in
Docx reader tests: Add tests for warnings.
5d48a62Jesse Rosenthal
tests/Tests/Readers/Docx.hs+13
@@ -57,6 +57,19 @@ testCompareWithOpts opts name docxFile nativeFile =
57testCompare :: String -> FilePath -> FilePath -> Test
57testCompare :: String -> FilePath -> FilePath -> Test
58testCompare = testCompareWithOpts def
58testCompare = testCompareWithOpts def
59
59
60+testForWarningsWithOptsIO :: ReaderOptions -> String -> FilePath -> [String] -> IO Test
61+testForWarningsWithOptsIO opts name docxFile expected = do
62+ df <- B.readFile docxFile
63+ let (_, _, warns) = handleError $ readDocxWithWarnings opts df
64+ return $ test id name (unlines warns, unlines expected)
65+
66+testForWarningsWithOpts :: ReaderOptions -> String -> FilePath -> [String] -> Test
67+testForWarningsWithOpts opts name docxFile expected =
68+ buildTest $ testForWarningsWithOptsIO opts name docxFile expected
69+
70+-- testForWarnings :: String -> FilePath -> [String] -> Test
71+-- testForWarnings = testForWarningsWithOpts def
72+
60getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
73getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
61getMedia archivePath mediaPath = do
74getMedia archivePath mediaPath = do
62 zf <- B.readFile archivePath >>= return . toArchive
75 zf <- B.readFile archivePath >>= return . toArchive