diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-08-13 12:20:25 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-08-13 12:20:25 -0700 |
commit | 76d14bcc11c655996c0a85eb5d5ce2dbca39fe17 (patch) | |
tree | 1c59ed0d147d8c5dbfe1fbb2ecf4b9b5a08a0ad7 /tests/Tests/Old.hs | |
parent | 0492ab868ba6881e6fbd943dbeb8daf1087cb1f5 (diff) |
Old tests: better path for test program.
Diffstat (limited to 'tests/Tests/Old.hs')
-rw-r--r-- | tests/Tests/Old.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs index 19461f74f..300430e79 100644 --- a/tests/Tests/Old.hs +++ b/tests/Tests/Old.hs @@ -6,7 +6,7 @@ import Test.HUnit ( assertBool ) import System.Environment.Executable (getExecutablePath) import System.IO ( openTempFile, stderr ) import System.Process ( runProcess, waitForProcess ) -import System.FilePath ( (</>), (<.>), takeDirectory ) +import System.FilePath ( (</>), (<.>), takeDirectory, splitDirectories, joinPath ) import System.Directory import System.Exit import Data.Algorithm.Diff @@ -232,7 +232,9 @@ testWithNormalize normalizer testname opts inp norm = testCase testname $ do found <- doesFileExist (testExeDir </> "pandoc") return $ if found then testExeDir </> "pandoc" - else testExeDir </> ".." </> "pandoc" </> "pandoc" + else case splitDirectories testExeDir of + [] -> error "test-pandoc: empty testExeDir" + xs -> joinPath (init xs) </> "pandoc" </> "pandoc" (outputPath, hOut) <- openTempFile "" "pandoc-test" let inpPath = inp let normPath = norm |