programming_languages/sml/week3_2020/test.sml

17 lines
372 B
Standard ML
Raw Permalink Normal View History

2020-06-06 01:56:32 +03:00
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