Docx reader tests: Add tests for warnings.
We test to see if we emit any warnings.
This commit is contained in:
parent
032ba8dd0c
commit
5d48a62b74
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue