Skip to content

Commit 913fa35

Browse files
committed
document and compare test
1 parent 3667d62 commit 913fa35

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tests/runtime/fixed-size-list/runner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ include!(env!("BINDINGS"));
33
use test::fixed_size_lists::to_test::*;
44

55
fn main() {
6-
list_param([1,2,3,4]);
7-
list_param2([[1,2],[3,4]]);
6+
list_param([1, 2, 3, 4]);
7+
list_param2([[1, 2], [3, 4]]);
88
}

tests/runtime/fixed-size-list/test.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ struct Component;
55
export!(Component);
66

77
impl exports::test::fixed_size_lists::to_test::Guest for Component {
8-
fn list_param(_a: [u32; 4]) {}
9-
fn list_param2(_a: [[u32; 2]; 2]) {}
8+
fn list_param(a: [u32; 4]) {
9+
assert_eq!(a, [1, 2, 3, 4]);
10+
}
11+
fn list_param2(a: [[u32; 2]; 2]) {
12+
assert_eq!(a, [[1, 2], [3, 4]]);
13+
}
1014
// fn list_param3(_a: [i32; 20]) {}
1115
}

tests/runtime/fixed-size-list/test.wit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// run with "--runner wasmtime -W component-model-fixed-size-list"
2+
13
package test:fixed-size-lists;
24

35
interface to-test {

0 commit comments

Comments
 (0)