git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #1351 from jkr/testWithOptions
ceb4bb3John MacFarlane
tests/Tests/Readers/Docx.hs+11−8
@@ -8,20 +8,23 @@ import Test.Framework
8import qualified Data.ByteString.Lazy as B
8import qualified Data.ByteString.Lazy as B
9import Text.Pandoc.Readers.Docx
9import Text.Pandoc.Readers.Docx
10
10
11−compareOutput :: FilePath -> FilePath -> IO (Pandoc, Pandoc)
11+compareOutput :: ReaderOptions -> FilePath -> FilePath -> IO (Pandoc, Pandoc)
12−compareOutput docxFile nativeFile = do
12+compareOutput opts docxFile nativeFile = do
13 df <- B.readFile docxFile
13 df <- B.readFile docxFile
14 nf <- Prelude.readFile nativeFile
14 nf <- Prelude.readFile nativeFile
15− return $ (readDocx def df, readNative nf)
15+ return $ (readDocx opts df, readNative nf)
16
16
17−testCompare' :: String -> FilePath -> FilePath -> IO Test
17+testCompareWithOptsIO :: ReaderOptions -> String -> FilePath -> FilePath -> IO Test
18−testCompare' name docxFile nativeFile = do
18+testCompareWithOptsIO opts name docxFile nativeFile = do
19− (dp, np) <- compareOutput docxFile nativeFile
19+ (dp, np) <- compareOutput opts docxFile nativeFile
20 return $ test id name (dp, np)
20 return $ test id name (dp, np)
21
21
22+testCompareWithOpts :: ReaderOptions -> String -> FilePath -> FilePath -> Test
23+testCompareWithOpts opts name docxFile nativeFile =
24+ buildTest $ testCompareWithOptsIO opts name docxFile nativeFile
25+
22testCompare :: String -> FilePath -> FilePath -> Test
26testCompare :: String -> FilePath -> FilePath -> Test
23−testCompare name docxFile nativeFile =
27+testCompare = testCompareWithOpts def
24− buildTest $ testCompare' name docxFile nativeFile
25
28
26
29
27tests :: [Test]
30tests :: [Test]