Skip to content

Commit 1c2c7a2

Browse files
committed
Add test to make sure fixed length works
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 5be9d5f commit 1c2c7a2

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/hyperlight_host/tests/wit_test.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ impl test::wit::Roundtrip for Host {
155155
) -> test::wit::roundtrip::Testenum {
156156
x
157157
}
158+
fn roundtrip_fix_list(&mut self, x: Vec<u8>) -> Vec<u8> {
159+
x
160+
}
158161

159162
fn roundtrip_no_result(&mut self, _x: u32) {}
160163
}
@@ -331,6 +334,7 @@ mod wit_test {
331334
make_test! { roundtrip_flags_large, in arb_largeflags() }
332335
make_test! { roundtrip_variant, in arb_testvariant() }
333336
make_test! { roundtrip_enum, in arb_testenum() }
337+
make_test! { roundtrip_fix_list, : Vec<u8> }
334338

335339
#[test]
336340
fn test_simple_func() {

src/tests/rust_guests/witguest/guest.wit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ interface roundtrip {
2626
roundtrip-option: func(x: option<string>) -> option<string>;
2727
roundtrip-result: func(x: result<char, string>) -> result<char, string>;
2828
roundtrip-no-result: func(x: u32);
29+
roundtrip-fix-list: func(x: list<u8, 4>) -> list<u8, 4>;
2930

3031
record testrecord {
3132
contents: string,

src/tests/rust_guests/witguest/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ impl test::wit::Roundtrip for Guest {
113113
) -> test::wit::roundtrip::Testenum {
114114
(Host {}).roundtrip_enum(x)
115115
}
116+
fn roundtrip_fix_list(&mut self, x: Vec<u8>) -> Vec<u8> {
117+
(Host {}).roundtrip_fix_list(x)
118+
}
116119
fn roundtrip_no_result(&mut self, x: u32) {
117120
(Host {}).roundtrip_no_result(x)
118121
}

0 commit comments

Comments
 (0)