programming_languages/sml/week3/test.sml
2020-06-04 23:09:44 +03:00

17 lines
No EOL
372 B
Standard ML

fun assert condition message =
if condition
then
print (message ^ "\n")
else
let
val () = print ("Assert error: " ^ message ^ "\n")
in
OS.Process.exit OS.Process.failure
end
fun complete () =
let
val () = print "All tests passed!"
in
OS.Process.exit OS.Process.success
end