From 7433215b3586cadd7262641ba9b3ff1139588ddd Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 28 Jun 2022 15:00:43 +0200 Subject: [PATCH] Commented some test that are no longer relevant with new Context API --- tests/compilers/native_functions.rs | 58 ++++++++++++++--------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/compilers/native_functions.rs b/tests/compilers/native_functions.rs index 228f50b3959..75db75ae718 100644 --- a/tests/compilers/native_functions.rs +++ b/tests/compilers/native_functions.rs @@ -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| { - 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| { +// println!("{}", state); +// }); +//} #[compiler_test(native_functions)] fn non_native_functions_and_closures_with_no_env_work(config: crate::Config) -> anyhow::Result<()> {