Skip to content

Commit ae93367

Browse files
committed
add tests
1 parent db35955 commit ae93367

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

extensions/circuit/src/wom_traits.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ where
297297
from_state: ExecutionState<u32>,
298298
) -> ResultVm<ExecutionState<u32>> {
299299
let mut fp = self.fp.lock().unwrap();
300-
println!("Executing inside VmChipWrapperWom instruction: {instruction:?}, from_state: {from_state:?}, fp: {fp}");
301300
let (reads, read_record) = self.adapter.preprocess(memory, *fp, instruction)?;
302301
let (output, core_record) =
303302
self.core

integration/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,15 +1489,14 @@ mod wast_tests {
14891489
#[test]
14901490
fn test_i32_add_all() -> Result<(), Box<dyn std::error::Error>> {
14911491
// Load all test cases from the add_only.wast file
1492-
let test_cases = extract_wast_test_info("../add_only.wast")?;
1492+
let test_cases = extract_wast_test_info("../wasm_tests/add_only.wast")?;
14931493

14941494
// Run all test cases
14951495
for (module_path, _line, cases) in &test_cases {
14961496
// Prepend ../ to the module path since we're running from integration directory
1497-
let full_module_path = format!("../{module_path}");
1497+
let full_module_path = format!("../wasm_tests/{module_path}");
14981498

14991499
for (function, args, expected) in cases {
1500-
println!("Running: {function}({args:?}) = {expected:?}");
15011500
run_single_wast_test(&full_module_path, function, args, expected)?;
15021501
}
15031502
}

wasm_tests/add_only.0.wasm

59 Bytes
Binary file not shown.

wasm_tests/add_only.wast

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
;; i32 add operation only
2+
(module
3+
(func (export "add") (param $x i32) (param $y i32) (result i32) (i32.add (local.get $x) (local.get $y)))
4+
)
5+
6+
(assert_return (invoke "add" (i32.const 1) (i32.const 1)) (i32.const 2))
7+
(assert_return (invoke "add" (i32.const 1) (i32.const 0)) (i32.const 1))
8+
(assert_return (invoke "add" (i32.const -1) (i32.const -1)) (i32.const -2))
9+
(assert_return (invoke "add" (i32.const -1) (i32.const 1)) (i32.const 0))
10+
(assert_return (invoke "add" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x80000000))
11+
(assert_return (invoke "add" (i32.const 0x80000000) (i32.const -1)) (i32.const 0x7fffffff))
12+
(assert_return (invoke "add" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0))
13+
(assert_return (invoke "add" (i32.const 0x3fffffff) (i32.const 1)) (i32.const 0x40000000))

0 commit comments

Comments
 (0)