Skip to content

Commit 32a2c52

Browse files
committed
fix error for when test isn't build
1 parent 5b9e1a4 commit 32a2c52

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test2.moon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ benchmark = (fn) ->
4343
nil, fn!
4444

4545
read_all = (fname) ->
46-
f = io.open(fname, "r")
47-
with f\read "*a"
48-
f\close!
46+
if f = io.open(fname, "r")
47+
with f\read "*a"
48+
f\close!
4949

5050
diff_file = (a_fname, b_fname) ->
5151
out = io.popen(options.diff.tool .. " ".. a_fname .. " " .. b_fname, "r")\read "*a"
@@ -107,7 +107,7 @@ describe "input tests", ->
107107
\close!
108108
else
109109
expected_str = read_all output_fname name
110-
return "Test not built: " .. input_fname(name) unless expected_str
110+
error "Test not built: " .. input_fname(name) unless expected_str
111111

112112
string_assert expected_str, code
113113

0 commit comments

Comments
 (0)