git.iko.soy/typeable/pandoc
on master help sign in
Updated test runner for changes in pandoc.
commit56ff5e1845363dea91423b785f1c28cabed213bb authorJohn MacFarlane <fiddlosopher@gmail.com> dateThu 3 Jan 2013, 11:20 (14 years ago) parent2014e2b
1 file changed+6−6
tests/Tests/Old.hs+6−6
tests/Tests/Old.hs+6−6
@@ -27,7 +27,7 @@ pandocPath = ".." </> "dist" </> "build" </> "pandoc" </> "pandoc"
2727
2828data TestResult = TestPassed
2929 | TestError ExitCode
30− | TestFailed String FilePath [(DI, String)]
30+ | TestFailed String FilePath [Diff String]
3131 deriving (Eq)
3232
3333instance Show TestResult where
@@ -39,13 +39,13 @@ instance Show TestResult where
3939 dash
4040 where dash = replicate 72 '-'
4141
42−showDiff :: (Int,Int) -> [(DI, String)] -> String
42+showDiff :: (Int,Int) -> [Diff String] -> String
4343showDiff _ [] = ""
44−showDiff (l,r) ((F, ln) : ds) =
44+showDiff (l,r) (First ln : ds) =
4545 printf "+%4d " l ++ ln ++ "\n" ++ showDiff (l+1,r) ds
46−showDiff (l,r) ((S, ln) : ds) =
46+showDiff (l,r) (Second ln : ds) =
4747 printf "-%4d " r ++ ln ++ "\n" ++ showDiff (l,r+1) ds
48−showDiff (l,r) ((B, _ ) : ds) =
48+showDiff (l,r) (Both _ _ : ds) =
4949 showDiff (l+1,r+1) ds
5050
5151tests :: [Test]
@@ -209,7 +209,7 @@ testWithNormalize normalizer testname opts inp norm = testCase testname $ do
209209 (outputPath, hOut) <- openTempFile "" "pandoc-test"
210210 let inpPath = inp
211211 let normPath = norm
212− let options = ["--data-dir", ".."] ++ [inpPath] ++ opts
212+ let options = ["--data-dir", ".." </> "data"] ++ [inpPath] ++ opts
213213 let cmd = pandocPath ++ " " ++ unwords options
214214 ph <- runProcess pandocPath options Nothing
215215 (Just [("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./")]) Nothing (Just hOut)