Commit 6368b28c authored by Benedikt Becker's avatar Benedikt Becker

Tune mlw_printer

parent 3af6b8c9
...@@ -298,16 +298,8 @@ list_stuff () { ...@@ -298,16 +298,8 @@ list_stuff () {
test_mlw_printer () { test_mlw_printer () {
python3 -m sexpdata || return python3 -m sexpdata || return
bench/test_mlw_printer "bench/valid/booleans.mlw" || exit 1 bench/test_mlw_printer bench/valid/*.mlw
bench/test_mlw_printer "bench/valid/complex_arg_1.mlw" || exit 1 bench/test_mlw_printer bench/typing/good/*.mlw
bench/test_mlw_printer "bench/valid/complex_arg_2.mlw" || exit 1
bench/test_mlw_printer "bench/valid/division.mlw" || exit 1
bench/test_mlw_printer "bench/valid/exns.mlw" || exit 1
bench/test_mlw_printer "bench/valid/oldify.mlw" || exit 1
bench/test_mlw_printer "bench/valid/recfun.mlw" || exit 1
bench/test_mlw_printer "bench/valid/see.mlw" || exit 1
bench/test_mlw_printer "bench/valid/type_invariant.mlw" || exit 1
bench/test_mlw_printer "bench/valid/wpcalls.mlw" || exit 1
} }
echo "=== Checking stdlib ===" echo "=== Checking stdlib ==="
......
...@@ -53,11 +53,14 @@ def trace(path, sexp, sexp1): ...@@ -53,11 +53,14 @@ def trace(path, sexp, sexp1):
def test(filename): def test(filename):
sexp0 = read(filename) sexp0 = read(filename)
sexp1 = print_and_read(filename)
try: try:
sexp1 = print_and_read(filename)
assert_equal([], sexp0, sexp1) assert_equal([], sexp0, sexp1)
print("OK:", filename) print("OK:", filename)
return True return True
except AssertionError:
print("CANT REPARSE:", filename)
return False
except NotEqual as e: except NotEqual as e:
print("FAILED:", filename) print("FAILED:", filename)
# sexpdata.dump(trace(e.path, sexp0, e.sexp1), sys.stdout) # sexpdata.dump(trace(e.path, sexp0, e.sexp1), sys.stdout)
......
...@@ -8,9 +8,9 @@ module M2 ...@@ -8,9 +8,9 @@ module M2
use int.Int use int.Int
let f (x : int) let f (x : int)
requires {(x = 6)} requires { x = 6 }
ensures { (result = 42) } = ensures { result = 42 } =
(Int.(*) x 7) Int.(*) x 7
end end
module M3 module M3
...@@ -18,8 +18,8 @@ module M3 ...@@ -18,8 +18,8 @@ module M3
use ref.Ref use ref.Ref
let f (_ : ()) let f (_ : ())
ensures { (Int.(>=) result 0) } = ensures { Int.(>=) result 0 } =
(let x = (Ref.ref 42) in Ref.(!) x) let x = Ref.ref 42 in Ref.(!) x
end end
module M4 module M4
...@@ -27,9 +27,9 @@ module M4 ...@@ -27,9 +27,9 @@ module M4
use array.Array use array.Array
let f (a : Array.array int) let f (a : Array.array int)
requires {(Int.(>=) (Array.length a) 1)} requires { Int.(>=) (Array.length a) 1 }
returns { _ -> (Array.([]) a 0) = 42 } = returns { _ -> (Array.([]) a 0) = 42 } =
(Array.([]<-) a 0 42) Array.([]<-) a 0 42
end end
Tasks are: Tasks are:
Task 1: theory Task Task 1: theory Task
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment