From 58edf9f5757daadeeaa7879785c48363fa154996 Mon Sep 17 00:00:00 2001 From: Yuji Yamamoto Date: Tue, 4 Jul 2017 05:37:58 +0900 Subject: Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings --- haddock-test/src/Test/Haddock/Utils.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'haddock-test/src/Test/Haddock/Utils.hs') diff --git a/haddock-test/src/Test/Haddock/Utils.hs b/haddock-test/src/Test/Haddock/Utils.hs index a947fea1..58408aaf 100644 --- a/haddock-test/src/Test/Haddock/Utils.hs +++ b/haddock-test/src/Test/Haddock/Utils.hs @@ -48,3 +48,10 @@ copyFile' :: FilePath -> FilePath -> IO () copyFile' old new = do createDirectoryIfMissing True $ takeDirectory new copyFile old new + + +crlfToLf :: String -> String +crlfToLf "" = "" +crlfToLf ('\r' : '\n' : rest) = '\n' : crlfToLf rest +crlfToLf ('\r' : rest) = '\n' : crlfToLf rest +crlfToLf (other : rest) = other : crlfToLf rest -- cgit v1.2.3