File tree Expand file tree Collapse file tree
hyperlight_component_macro/src
hyperlight_component_util/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,7 +119,8 @@ struct BindgenInputParams {
119119fn source_or_env ( source : Option < util:: WitSource > ) -> util:: WitSource {
120120 source. unwrap_or_else ( || {
121121 util:: WitSource :: Wasm ( std:: path:: PathBuf :: from (
122- std:: env:: var_os ( "WIT_WORLD" ) . unwrap ( ) ,
122+ std:: env:: var_os ( "WIT_WORLD" )
123+ . expect ( "WIT_WORLD must be set when bindgen input is omitted" ) ,
123124 ) )
124125 } )
125126}
Original file line number Diff line number Diff line change @@ -77,16 +77,19 @@ fn wasmtime_guest_codegen_emits_wasmtime_flags_macro() {
7777fn read_wit_type_accepts_wasm_encoded_wit ( ) {
7878 let wasm_path =
7979 encode_wit_fixture_to_wasm ( & fixture_path ( "../tests/rust_guests/witguest/guest.wit" ) ) ;
80- let kebab_name = util:: read_wit_type (
80+ let ( kebab_name, has_import_or_export ) = util:: read_wit_type (
8181 util:: WitSource :: Wasm ( wasm_path. clone ( ) ) ,
8282 None ,
8383 |kebab_name, ct| {
84- assert ! ( !ct. imports. is_empty( ) || !ct. instance. unqualified. exports. is_empty( ) ) ;
85- kebab_name
84+ (
85+ kebab_name,
86+ !ct. imports . is_empty ( ) || !ct. instance . unqualified . exports . is_empty ( ) ,
87+ )
8688 } ,
8789 ) ;
88- std:: fs:: remove_file ( wasm_path) . expect ( "temporary wasm fixture should be removed" ) ;
90+ std:: fs:: remove_file ( & wasm_path) . expect ( "temporary wasm fixture should be removed" ) ;
8991
92+ assert ! ( has_import_or_export) ;
9093 assert_eq ! ( kebab_name, "test:wit/test" ) ;
9194}
9295
You can’t perform that action at this time.
0 commit comments