on master help sign in
Whitespace (case blocks)
fac1c25Laszlo Pandy
tests/Test/Compiler.hs+6−2
@@ -101,8 +101,11 @@ testMatchesExpected elmDir expectedJsDir = do
101 readFileOrErrorStr filePath = do
101 readFileOrErrorStr filePath = do
102 strOrExc <- try $ readFile filePath
102 strOrExc <- try $ readFile filePath
103 case strOrExc of
103 case strOrExc of
104+ Right s ->
104− Right s -> return s
105+ return s
106+
105− Left (e :: IOException) -> return (show e)
107+ Left (e :: IOException) ->
108+ return (show e)
106
109
107 doTest filePath = do
110 doTest filePath = do
108 source <- readFile filePath
111 source <- readFile filePath
@@ -123,6 +126,7 @@ testMatchesExpected elmDir expectedJsDir = do
123 createDirectoryIfMissing True (dropFileName expectedFilePath)
126 createDirectoryIfMissing True (dropFileName expectedFilePath)
124 writeFile expectedFilePath js
127 writeFile expectedFilePath js
125 assertFailure ("Wrote new expected js: " ++ expectedFilePath)
128 assertFailure ("Wrote new expected js: " ++ expectedFilePath)
129+
126 _ ->
130 _ ->
127 assertFailure "Compile failed. Could not write new expected js."
131 assertFailure "Compile failed. Could not write new expected js."
128 return $ testCase filePath assertion
132 return $ testCase filePath assertion