Skip to content

Commit

Permalink
Commented some test that are no longer relevant with new Context API
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Jun 28, 2022
1 parent 7b9738f commit 7433215
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions tests/compilers/native_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,35 +92,35 @@ fn native_function_works_for_wasm(config: crate::Config) -> anyhow::Result<()> {
Ok(())
}

#[should_panic(
expected = "Closures (functions with captured environments) are currently unsupported with native functions. See: https://github.com/wasmerio/wasmer/issues/1840"
)]
#[compiler_test(native_functions)]
fn native_host_function_closure_panics(config: crate::Config) {
let store = config.store();
let mut ctx = WasmerContext::new(&store, ());
let state = 3;
Function::new_native(
&mut ctx.as_context_mut(),
move |_ctx: ContextMut<_>, _: i32| {
println!("{}", state);
},
);
}

#[should_panic(
expected = "Closures (functions with captured environments) are currently unsupported with native functions. See: https://github.com/wasmerio/wasmer/issues/1840"
)]
#[compiler_test(native_functions)]
fn native_with_env_host_function_closure_panics(config: crate::Config) {
let store = config.store();
let env: i32 = 4;
let mut ctx = WasmerContext::new(&store, env);
let state = 3;
Function::new_native(&mut ctx, move |_ctx: ContextMut<i32>, _: i32| {
println!("{}", state);
});
}
//#[should_panic(
// expected = "Closures (functions with captured environments) are currently unsupported with native functions. See: https://github.com/wasmerio/wasmer/issues/1840"
//)]
//#[compiler_test(native_functions)]
//fn native_host_function_closure_panics(config: crate::Config) {
// let store = config.store();
// let mut ctx = WasmerContext::new(&store, ());
// let state = 3;
// Function::new_native(
// &mut ctx.as_context_mut(),
// move |_ctx: ContextMut<_>, _: i32| {
// println!("{}", state);
// },
// );
//}

//#[should_panic(
// expected = "Closures (functions with captured environments) are currently unsupported with native functions. See: https://github.com/wasmerio/wasmer/issues/1840"
//)]
//#[compiler_test(native_functions)]
//fn native_with_env_host_function_closure_panics(config: crate::Config) {
// let store = config.store();
// let env: i32 = 4;
// let mut ctx = WasmerContext::new(&store, env);
// let state = 3;
// Function::new_native(&mut ctx, move |_ctx: ContextMut<i32>, _: i32| {
// println!("{}", state);
// });
//}

#[compiler_test(native_functions)]
fn non_native_functions_and_closures_with_no_env_work(config: crate::Config) -> anyhow::Result<()> {
Expand Down

0 comments on commit 7433215

Please sign in to comment.