Skip to content

Commit

Permalink
Merge pull request #1935 from larry0x/update-test-wat-format
Browse files Browse the repository at this point in the history
Update WAT format in several test cases
  • Loading branch information
chipshort authored Nov 3, 2023
2 parents fde26bd + 0a1d463 commit 6f5905c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/vm/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ mod tests {
static INVALID_CONTRACT_WAT: &str = r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 1
i32.add))
"#;
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/modules/file_system_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ mod tests {
const SOME_WAT: &str = r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 1
i32.add))
"#;
Expand Down
6 changes: 3 additions & 3 deletions packages/vm/src/modules/in_memory_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,21 @@ mod tests {
const WAT1: &str = r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 1
i32.add)
)"#;
const WAT2: &str = r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_two") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 2
i32.add)
)"#;
const WAT3: &str = r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_three") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 3
i32.add)
)"#;
Expand Down
10 changes: 5 additions & 5 deletions packages/vm/src/modules/pinned_memory_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ mod tests {
r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 1
i32.add)
)"#,
Expand Down Expand Up @@ -144,7 +144,7 @@ mod tests {
r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 1
i32.add)
)"#,
Expand Down Expand Up @@ -176,7 +176,7 @@ mod tests {
r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 1
i32.add)
)"#,
Expand Down Expand Up @@ -208,7 +208,7 @@ mod tests {
r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 1
i32.add)
)"#,
Expand All @@ -219,7 +219,7 @@ mod tests {
r#"(module
(type $t0 (func (param i32) (result i32)))
(func $add_one (export "add_two") (type $t0) (param $p0 i32) (result i32)
get_local $p0
local.get $p0
i32.const 2
i32.add)
)"#,
Expand Down
8 changes: 4 additions & 4 deletions packages/vm/src/wasm_backend/gatekeeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ mod tests {
r#"
(module
(func (export "sum") (param i32 i32) (result i32)
get_local 0
get_local 1
local.get 0
local.get 1
i32.add
))
"#,
Expand All @@ -732,8 +732,8 @@ mod tests {
r#"
(module
(func $to_float (param i32) (result f32)
get_local 0
f32.convert_u/i32
local.get 0
f32.convert_i32_u
))
"#,
)
Expand Down

0 comments on commit 6f5905c

Please sign in to comment.