Skip to content

Commit

Permalink
add assert.wat in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Laplace-Demon authored and zapashcanon committed Nov 16, 2024
1 parent 985e8a9 commit bb99e38
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/ast/code_generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,8 @@ let add_owi_funcs (owi_funcs : (string * binary func_type) array) (m : modul) :
in
update_func ()

let generate (symbolic : bool) (m : modul) : modul Result.t =
let owi_funcs =
if symbolic then [| ("assert", ([ (None, Num_type I32) ], [])) |]
else [| ("assert", ([ (None, Num_type I32) ], [])) |]
in
let generate (_symbolic : bool) (m : modul) : modul Result.t =
let owi_funcs = [| ("assert", ([ (None, Num_type I32) ], [])) |] in
let m, owi_funcs = add_owi_funcs owi_funcs m in
contracts_generate owi_funcs m
(List.filter_map
Expand Down
1 change: 1 addition & 0 deletions test/weasel/assert.t
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$ owi run --rac ./assert.wat
8 changes: 8 additions & 0 deletions test/weasel/assert.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(module
(@contract $start
(requires (= 2 (+ 1 1)))
)
(func $start
)
(start $start)
)
2 changes: 1 addition & 1 deletion test/weasel/dune
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(cram
(deps %{bin:owi} forall.wat plus.wat sum.wat))
(deps %{bin:owi} assert.wat forall.wat plus.wat sum.wat))

0 comments on commit bb99e38

Please sign in to comment.