diff options
author | Yuji Yamamoto <whosekiteneverfly@gmail.com> | 2017-07-04 05:37:58 +0900 |
---|---|---|
committer | Alex Biehl <alexbiehl@gmail.com> | 2017-07-03 22:37:58 +0200 |
commit | 58edf9f5757daadeeaa7879785c48363fa154996 (patch) | |
tree | f09972ba98497c06dccea65f513877efb10ba848 /haddock-test/src/Test/Haddock/Utils.hs | |
parent | a330da5297106ff214cbb5e74965d9d1ef9dab7b (diff) |
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
Diffstat (limited to 'haddock-test/src/Test/Haddock/Utils.hs')
-rw-r--r-- | haddock-test/src/Test/Haddock/Utils.hs | 7 |
1 files changed, 7 insertions, 0 deletions
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 |