on master help sign in
Don't let the tests write empty files even if there is an error.
commit9f15874ae3f3e9789e533d0c097b98bd7c311f04 authorLaszlo Pandy <laszlok2@gmail.com> dateSun 6 Sep 2015, 14:43 (11 years ago) parentef92a1d
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