diff --git a/Spr24/HW/Homework3/test_parse.sml b/Spr24/HW/Homework3/test_parse.sml index 9d69e50..4b9b36d 100644 --- a/Spr24/HW/Homework3/test_parse.sml +++ b/Spr24/HW/Homework3/test_parse.sml @@ -6,19 +6,19 @@ use "hw3_q3.sml"; smlnj test_parse.sml *) -exception TestFailure of string; +let + exception TestFailure of string; -local - fun sexp_to_string (ATOM(SYMBOL s)) = s - | sexp_to_string (ATOM NIL) = "NIL" - | sexp_to_string (CONS (x, y)) = "(" ^ sexp_to_string x ^ "." ^ sexp_to_string y ^ ")"; -in - fun assert_equal (expected, actual, msg) = - if expected = actual then () - else raise TestFailure (msg ^ ": expected " ^ sexp_to_string expected ^ ", but got " ^ sexp_to_string actual); -end; + local + fun sexp_to_string (ATOM(SYMBOL s)) = s + | sexp_to_string (ATOM NIL) = "NIL" + | sexp_to_string (CONS (x, y)) = "(" ^ sexp_to_string x ^ "." ^ sexp_to_string y ^ ")"; + in + fun assert_equal (expected, actual, msg) = + if expected = actual then () + else raise TestFailure (msg ^ ": expected " ^ sexp_to_string expected ^ ", but got " ^ sexp_to_string actual); + end; -let fun run_tests tests = let fun runTest (name, test) =