From 76d14bcc11c655996c0a85eb5d5ce2dbca39fe17 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 13 Aug 2014 12:20:25 -0700 Subject: Old tests: better path for test program. --- tests/Tests/Old.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3