aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-06-23 10:45:14 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2016-06-23 10:50:46 -0400
commit5d48a62b74989cd14eb66856c8c340b8c262a473 (patch)
tree2e860b3a18670492da692895f5f9d5d1c7389d0a /tests
parent032ba8dd0c235c47df1148f9bfa91dc277a09216 (diff)
downloadpandoc-5d48a62b74989cd14eb66856c8c340b8c262a473.tar.gz
Docx reader tests: Add tests for warnings.
We test to see if we emit any warnings.
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Docx.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs
index aeb6bf939..a1315446a 100644
--- a/tests/Tests/Readers/Docx.hs
+++ b/tests/Tests/Readers/Docx.hs
@@ -57,6 +57,19 @@ testCompareWithOpts opts name docxFile nativeFile =
testCompare :: String -> FilePath -> FilePath -> Test
testCompare = testCompareWithOpts def
+testForWarningsWithOptsIO :: ReaderOptions -> String -> FilePath -> [String] -> IO Test
+testForWarningsWithOptsIO opts name docxFile expected = do
+ df <- B.readFile docxFile
+ let (_, _, warns) = handleError $ readDocxWithWarnings opts df
+ return $ test id name (unlines warns, unlines expected)
+
+testForWarningsWithOpts :: ReaderOptions -> String -> FilePath -> [String] -> Test
+testForWarningsWithOpts opts name docxFile expected =
+ buildTest $ testForWarningsWithOptsIO opts name docxFile expected
+
+-- testForWarnings :: String -> FilePath -> [String] -> Test
+-- testForWarnings = testForWarningsWithOpts def
+
getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
getMedia archivePath mediaPath = do
zf <- B.readFile archivePath >>= return . toArchive