on master help sign in
Merge pull request #1048 from laszlopandy/test-fix-empty-expected-files

Test fix empty expected files

commit9af9dcbeccbe20069c38cace1cda06487bf41717 authorEvan Czaplicki <info@elm-lang.org> dateMon 7 Sep 2015, 17:08 (11 years ago) parentef92a1d9f15874
1 file changed+3
tests/Test/Compiler.hs+3
tests/Test/Compiler.hs+3
@@ -121,6 +121,9 @@ doWriteNewExpectedTest expectedJsDir filePath =
121121 case formattedResult of
122122 Right (Compiler.Result _ _ js) ->
123123 do createDirectoryIfMissing True (dropFileName expectedFilePath)
124+ -- Force the evaluation of "js" before "writeFile"
125+ -- so that if an error is raised we do not write an empty file.
126+ assertBool "Error: no content generated" (length js > 0)
124127 writeFile expectedFilePath js
125128 assertFailure ("Wrote new expected js: " ++ expectedFilePath)
126129