diff --git a/REPL/Main.lean b/REPL/Main.lean index 1261227..387ba10 100644 --- a/REPL/Main.lean +++ b/REPL/Main.lean @@ -211,10 +211,10 @@ open REPL /-- Get lines from stdin until a blank line is entered. -/ partial def getLines : IO String := do let line ← (← IO.getStdin).getLine - return if line.trim.isEmpty then - line + if line.trim.isEmpty then + return line else - line ++ (← getLines) + return line ++ (← getLines) instance [ToJson α] [ToJson β] : ToJson (α ⊕ β) where toJson x := match x with diff --git a/test.sh b/test.sh index 5a3697d..94085aa 100755 --- a/test.sh +++ b/test.sh @@ -27,12 +27,15 @@ for infile in $IN_DIR/*.in; do # Compare the output with the expected output if diff "$tmpfile" "$expectedfile"; then echo "$base: PASSED" + # Remove the temporary file + rm "$tmpfile" else echo "$base: FAILED" + # Remove the temporary file + rm "$tmpfile" + exit 1 fi - # Remove the temporary file - rm "$tmpfile" done # Run the Mathlib tests diff --git a/test/Mathlib/test.sh b/test/Mathlib/test.sh index abfb989..c7bc1c8 100755 --- a/test/Mathlib/test.sh +++ b/test/Mathlib/test.sh @@ -28,11 +28,14 @@ for infile in $IN_DIR/*.in; do # Compare the output with the expected output if diff "$tmpfile" "$expectedfile"; then echo "$base: PASSED" + # Remove the temporary file + rm "$tmpfile" else echo "$base: FAILED" + # Remove the temporary file + rm "$tmpfile" + exit 1 fi - # Remove the temporary file - rm "$tmpfile" done