@@ -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