Updated test runner for changes in pandoc.
This commit is contained in:
parent
2014e2b4ea
commit
56ff5e1845
1 changed files with 6 additions and 6 deletions
|
@ -27,7 +27,7 @@ pandocPath = ".." </> "dist" </> "build" </> "pandoc" </> "pandoc"
|
||||||
|
|
||||||
data TestResult = TestPassed
|
data TestResult = TestPassed
|
||||||
| TestError ExitCode
|
| TestError ExitCode
|
||||||
| TestFailed String FilePath [(DI, String)]
|
| TestFailed String FilePath [Diff String]
|
||||||
deriving (Eq)
|
deriving (Eq)
|
||||||
|
|
||||||
instance Show TestResult where
|
instance Show TestResult where
|
||||||
|
@ -39,13 +39,13 @@ instance Show TestResult where
|
||||||
dash
|
dash
|
||||||
where dash = replicate 72 '-'
|
where dash = replicate 72 '-'
|
||||||
|
|
||||||
showDiff :: (Int,Int) -> [(DI, String)] -> String
|
showDiff :: (Int,Int) -> [Diff String] -> String
|
||||||
showDiff _ [] = ""
|
showDiff _ [] = ""
|
||||||
showDiff (l,r) ((F, ln) : ds) =
|
showDiff (l,r) (First ln : ds) =
|
||||||
printf "+%4d " l ++ ln ++ "\n" ++ showDiff (l+1,r) ds
|
printf "+%4d " l ++ ln ++ "\n" ++ showDiff (l+1,r) ds
|
||||||
showDiff (l,r) ((S, ln) : ds) =
|
showDiff (l,r) (Second ln : ds) =
|
||||||
printf "-%4d " r ++ ln ++ "\n" ++ showDiff (l,r+1) ds
|
printf "-%4d " r ++ ln ++ "\n" ++ showDiff (l,r+1) ds
|
||||||
showDiff (l,r) ((B, _ ) : ds) =
|
showDiff (l,r) (Both _ _ : ds) =
|
||||||
showDiff (l+1,r+1) ds
|
showDiff (l+1,r+1) ds
|
||||||
|
|
||||||
tests :: [Test]
|
tests :: [Test]
|
||||||
|
@ -209,7 +209,7 @@ testWithNormalize normalizer testname opts inp norm = testCase testname $ do
|
||||||
(outputPath, hOut) <- openTempFile "" "pandoc-test"
|
(outputPath, hOut) <- openTempFile "" "pandoc-test"
|
||||||
let inpPath = inp
|
let inpPath = inp
|
||||||
let normPath = norm
|
let normPath = norm
|
||||||
let options = ["--data-dir", ".."] ++ [inpPath] ++ opts
|
let options = ["--data-dir", ".." </> "data"] ++ [inpPath] ++ opts
|
||||||
let cmd = pandocPath ++ " " ++ unwords options
|
let cmd = pandocPath ++ " " ++ unwords options
|
||||||
ph <- runProcess pandocPath options Nothing
|
ph <- runProcess pandocPath options Nothing
|
||||||
(Just [("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./")]) Nothing (Just hOut)
|
(Just [("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./")]) Nothing (Just hOut)
|
||||||
|
|
Loading…
Reference in a new issue