git.iko.soy/typeable/pandoc
on master help sign in
Bugs fixed in RunTests.hs:

+ 'r' -> '\r' + use a strict version of readFile to make sure file is closed and can be removed git-svn-id: https://pandoc.googlecode.com/svn/trunk@1413 788f1e2b-df1e-0410-8736-df70ead52e1b

commita23f8ba5bdd6bc4da9f3c13d469477c801b020d7 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 23 Aug 2008, 18:55 (18 years ago) parent2323278
1 file changed+7−2
tests/RunTests.hs+7−2
tests/RunTests.hs+7−2
@@ -81,6 +81,11 @@ main = do
8181 putStrLn $ "\n" ++ show failures ++ " tests failed."
8282 exitWith (ExitFailure failures)
8383
84+-- makes sure file is fully closed after reading
85+readFile' :: FilePath -> IO String
86+readFile' f = do s <- readFile f
87+ return $! (length s `seq` s)
88+
8489runWriterTest :: String -> IO Bool
8590runWriterTest format = do
8691 r1 <- runTest (format ++ " writer") ["-r", "native", "-s", "-w", format] "testsuite.native" ("writer" <.> format)
@@ -107,8 +112,8 @@ runTest testname opts inp norm = do
107112 result <- if ec == ExitSuccess
108113 then do
109114 -- filter \r so the tests will work on Windows machines
110− outputContents <- readFile outputPath >>= return . filter (/='r')
111− normContents <- readFile normPath >>= return . filter (/='r')
115+ outputContents <- readFile' outputPath >>= return . filter (/='\r')
116+ normContents <- readFile' normPath >>= return . filter (/='\r')
112117 if outputContents == normContents
113118 then return TestPassed
114119 else return $ TestFailed $ getDiff (lines outputContents) (lines normContents)