on master help sign in
cosmetic: change whitespace a bit
commit95b4c4ddf4ee77090900542ca9de73f780c51bf7 authorEvan Czaplicki <info@elm-lang.org> dateWed 21 Oct 2015, 12:43 (11 years ago) parent3285694
1 file changed+11−1
tests/Test/Compiler.hs+11−1
tests/Test/Compiler.hs+11−1
@@ -19,6 +19,8 @@ import Test.HUnit (Assertion, assertFailure, assertBool, assertEqual)
1919import qualified Elm.Compiler as Compiler
2020import qualified Elm.Package as Package
2121
22+
23+
2224writeExpectedJsEnvVarName :: String
2325writeExpectedJsEnvVarName =
2426 "ELM_WRITE_NEW_EXPECTED"
@@ -38,8 +40,10 @@ compilerTests =
3840 ]
3941
4042
43+
4144-- GATHER FILES
4245
46+
4347getElms :: FilePath -> IO [FilePath]
4448getElms filePath =
4549 find
@@ -54,14 +58,16 @@ testsDir =
5458
5559convertToExpectedJsFilePath :: String -> FilePath -> FilePath
5660convertToExpectedJsFilePath expectedJsDir filePath =
57− testsDir
61+ testsDir
5862 </> expectedJsDir
5963 </> joinPath (drop 3 (splitDirectories filePath))
6064 <.> ".js"
6165
6266
67+
6368-- TEST HELPERS
6469
70+
6571compileString :: FilePath -> String -> Either String Compiler.Result
6672compileString filePath source =
6773 let context =
@@ -85,8 +91,10 @@ readFileOrErrorStr filePath =
8591 return (show e)
8692
8793
94+
8895-- RUN TESTS
8996
97+
9098testIf
9199 :: (Either String Compiler.Result -> Assertion)
92100 -> [FilePath]
@@ -143,8 +151,10 @@ testMatchesExpected elmDir expectedJsDir =
143151 traverse (doMatchesExpectedTest expectedJsDir) elmFiles
144152
145153
154+
146155-- CHECK RESULTS
147156
157+
148158isSuccess :: Either String a -> Assertion
149159isSuccess result =
150160 case result of