From e90b31bb4a57d468c5d8428f7d84fe0ec31bea41 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 5 Feb 2017 14:38:50 +0200 Subject: [PATCH 1/3] Add appveyor.yml --- appveyor.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..8f05d2cf --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,16 @@ +build: off + +before_test: +- curl -sS -ostack.zip -L --insecure http://www.stackage.org/stack/windows-i386 +- 7z x stack.zip stack.exe + +clone_folder: "c:\\stack" +environment: + global: + STACK_ROOT: "c:\\sr" + +test_script: +- stack setup > nul +# The ugly echo "" hack is to avoid complaints about 0 being an invalid file +# descriptor +- echo "" | stack --no-terminal test From 954f813569278ea80df61942537c91c1ab79d78e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 7 Feb 2017 15:23:35 +0200 Subject: [PATCH 2/3] Fix route parsing for CRLF line endings --- yesod-core/Yesod/Routes/Parse.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-core/Yesod/Routes/Parse.hs b/yesod-core/Yesod/Routes/Parse.hs index b5be876a..580f23d6 100644 --- a/yesod-core/Yesod/Routes/Parse.hs +++ b/yesod-core/Yesod/Routes/Parse.hs @@ -63,7 +63,7 @@ parseRoutesNoCheck = QuasiQuoter -- invalid input. resourcesFromString :: String -> [ResourceTree String] resourcesFromString = - fst . parse 0 . filter (not . all (== ' ')) . lines + fst . parse 0 . filter (not . all (== ' ')) . lines . filter (/= '\r') where parse _ [] = ([], []) parse indent (thisLine:otherLines) From 1bc1ef5a35e0fae15ee990fa1876cdc91a2fc4e3 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 7 Feb 2017 15:51:16 +0200 Subject: [PATCH 3/3] Fix a CR test failure --- yesod-static/test/FileGeneratorTests.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yesod-static/test/FileGeneratorTests.hs b/yesod-static/test/FileGeneratorTests.hs index d1bffa34..98660724 100644 --- a/yesod-static/test/FileGeneratorTests.hs +++ b/yesod-static/test/FileGeneratorTests.hs @@ -78,7 +78,8 @@ fileGenSpecs = do describe "Compress" $ do it "compress tool function" $ do out <- compressTool "runhaskell" [] "main = putStrLn \"Hello World\"" - assertEqual "" "Hello World\n" out + -- 13 == CR, to make this test work on Windows + BL.filter (/= 13) out `shouldBe` "Hello World\n" it "tryCompressTools" $ do out <- flip tryCompressTools "abcdef"