Skip to content

Commit a68cdc5

Browse files
committed
Add a test that Callback::forget works
1 parent 8057386 commit a68cdc5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/headless/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,11 @@ pub mod snippets;
5151
pub mod modules;
5252
pub mod anyref_heap_live_count;
5353
pub mod strings;
54+
55+
#[wasm_bindgen_test]
56+
fn closures_work() {
57+
let x = Closure::wrap(Box::new(|| {}) as Box<FnMut()>);
58+
drop(x);
59+
let x = Closure::wrap(Box::new(|| {}) as Box<FnMut()>);
60+
x.forget();
61+
}

0 commit comments

Comments
 (0)