Skip to content

Commit

Permalink
valide binary module in script, promote tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Jul 3, 2024
1 parent d265297 commit 93b8a72
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/script/script.ml
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,13 @@ let run ~no_exhaustion ~optimize script =
let+ () =
match got with
| Error got -> check_error ~expected ~got
| Ok m ->
(* TODO: there should be some checks here before linking ! *)
let got = Link.modul link_state ~name:None m in
check_error_result expected got
| Ok m -> begin
match Typecheck.modul m with
| Error got -> check_error ~expected ~got
| Ok () ->
let got = Link.modul link_state ~name:None m in
check_error_result expected got
end
in
link_state
| Assert (Assert_invalid (m, expected)) ->
Expand Down
2 changes: 1 addition & 1 deletion test/script/reference.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ owi script --no-exhaustion reference/address.wast
$ owi script --no-exhaustion reference/align.wast
expected alignment must not be larger than natural but there was no error
expected malformed memop flags but there was no error
[7]
$ owi script --no-exhaustion reference/binary-leb128.wast
$ owi script --no-exhaustion reference/binary.wast
Expand Down
2 changes: 1 addition & 1 deletion test/script/reference_opt.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ owi script --no-exhaustion --optimize reference/address.wast
$ owi script --no-exhaustion --optimize reference/align.wast
expected alignment must not be larger than natural but there was no error
expected malformed memop flags but there was no error
[7]
$ owi script --no-exhaustion --optimize reference/binary-leb128.wast
$ owi script --no-exhaustion --optimize reference/binary.wast
Expand Down

0 comments on commit 93b8a72

Please sign in to comment.