diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-06-19 11:01:56 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-06-19 11:01:56 -0700 |
commit | ceb4bb3250df18a97b65fdb64062c820d15b7d8e (patch) | |
tree | 3796ecba214bf0c781ab60dcb8066c1eb26c6281 /tests/Tests | |
parent | 00281559bf9c955ece6b18d48ef487fdc5f4406e (diff) | |
parent | ceb742b1246f975437d7a0083139d248c94036b5 (diff) | |
download | pandoc-ceb4bb3250df18a97b65fdb64062c820d15b7d8e.tar.gz |
Merge pull request #1351 from jkr/testWithOptions
Add ReaderOptions to the docx tests
Diffstat (limited to 'tests/Tests')
-rw-r--r-- | tests/Tests/Readers/Docx.hs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs index 0a963ddc6..273f03f4d 100644 --- a/tests/Tests/Readers/Docx.hs +++ b/tests/Tests/Readers/Docx.hs @@ -8,20 +8,23 @@ import Test.Framework import qualified Data.ByteString.Lazy as B import Text.Pandoc.Readers.Docx -compareOutput :: FilePath -> FilePath -> IO (Pandoc, Pandoc) -compareOutput docxFile nativeFile = do +compareOutput :: ReaderOptions -> FilePath -> FilePath -> IO (Pandoc, Pandoc) +compareOutput opts docxFile nativeFile = do df <- B.readFile docxFile nf <- Prelude.readFile nativeFile - return $ (readDocx def df, readNative nf) + return $ (readDocx opts df, readNative nf) -testCompare' :: String -> FilePath -> FilePath -> IO Test -testCompare' name docxFile nativeFile = do - (dp, np) <- compareOutput docxFile nativeFile +testCompareWithOptsIO :: ReaderOptions -> String -> FilePath -> FilePath -> IO Test +testCompareWithOptsIO opts name docxFile nativeFile = do + (dp, np) <- compareOutput opts docxFile nativeFile return $ test id name (dp, np) +testCompareWithOpts :: ReaderOptions -> String -> FilePath -> FilePath -> Test +testCompareWithOpts opts name docxFile nativeFile = + buildTest $ testCompareWithOptsIO opts name docxFile nativeFile + testCompare :: String -> FilePath -> FilePath -> Test -testCompare name docxFile nativeFile = - buildTest $ testCompare' name docxFile nativeFile +testCompare = testCompareWithOpts def tests :: [Test] |