programming_languages/sml/week4/test.sml

17 lines
372 B
Standard ML
Raw Normal View History

2020-06-05 04:57:25 +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