git.iko.soy/typeable/pandoc
on master help sign in
Old tests: better path for test program.
commit76d14bcc11c655996c0a85eb5d5ce2dbca39fe17 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 13 Aug 2014, 12:20 (12 years ago) parent0492ab8
1 file changed+4−2
tests/Tests/Old.hs+4−2
tests/Tests/Old.hs+4−2
@@ -6,7 +6,7 @@ import Test.HUnit ( assertBool )
66import System.Environment.Executable (getExecutablePath)
77import System.IO ( openTempFile, stderr )
88import System.Process ( runProcess, waitForProcess )
9−import System.FilePath ( (</>), (<.>), takeDirectory )
9+import System.FilePath ( (</>), (<.>), takeDirectory, splitDirectories, joinPath )
1010import System.Directory
1111import System.Exit
1212import Data.Algorithm.Diff
@@ -232,7 +232,9 @@ testWithNormalize normalizer testname opts inp norm = testCase testname $ do
232232 found <- doesFileExist (testExeDir </> "pandoc")
233233 return $ if found
234234 then testExeDir </> "pandoc"
235− else testExeDir </> ".." </> "pandoc" </> "pandoc"
235+ else case splitDirectories testExeDir of
236+ [] -> error "test-pandoc: empty testExeDir"
237+ xs -> joinPath (init xs) </> "pandoc" </> "pandoc"
236238 (outputPath, hOut) <- openTempFile "" "pandoc-test"
237239 let inpPath = inp
238240 let normPath = norm