summaryrefslogtreecommitdiff
path: root/tests/Tests/Old.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-01-03 11:20:10 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-01-03 11:20:10 -0800
commit56ff5e1845363dea91423b785f1c28cabed213bb (patch)
tree1bbe7ae14cd79eb5ad6939158a0b96455e3d3978 /tests/Tests/Old.hs
parent2014e2b4eaa1d82b29de772d9ea836e4ac2138d1 (diff)
Updated test runner for changes in pandoc.
Diffstat (limited to 'tests/Tests/Old.hs')
-rw-r--r--tests/Tests/Old.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs
index 484d61561..d35620062 100644
--- a/tests/Tests/Old.hs
+++ b/tests/Tests/Old.hs
@@ -27,7 +27,7 @@ pandocPath = ".." </> "dist" </> "build" </> "pandoc" </> "pandoc"
data TestResult = TestPassed
| TestError ExitCode
- | TestFailed String FilePath [(DI, String)]
+ | TestFailed String FilePath [Diff String]
deriving (Eq)
instance Show TestResult where
@@ -39,13 +39,13 @@ instance Show TestResult where
dash
where dash = replicate 72 '-'
-showDiff :: (Int,Int) -> [(DI, String)] -> String
+showDiff :: (Int,Int) -> [Diff String] -> String
showDiff _ [] = ""
-showDiff (l,r) ((F, ln) : ds) =
+showDiff (l,r) (First ln : 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
-showDiff (l,r) ((B, _ ) : ds) =
+showDiff (l,r) (Both _ _ : ds) =
showDiff (l+1,r+1) ds
tests :: [Test]
@@ -209,7 +209,7 @@ testWithNormalize normalizer testname opts inp norm = testCase testname $ do
(outputPath, hOut) <- openTempFile "" "pandoc-test"
let inpPath = inp
let normPath = norm
- let options = ["--data-dir", ".."] ++ [inpPath] ++ opts
+ let options = ["--data-dir", ".." </> "data"] ++ [inpPath] ++ opts
let cmd = pandocPath ++ " " ++ unwords options
ph <- runProcess pandocPath options Nothing
(Just [("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./")]) Nothing (Just hOut)