Skip to content

Commit

Permalink
Add a test that Callback::forget works
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed May 20, 2019
1 parent 8057386 commit a68cdc5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/headless/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,11 @@ pub mod snippets;
pub mod modules;
pub mod anyref_heap_live_count;
pub mod strings;

#[wasm_bindgen_test]
fn closures_work() {
let x = Closure::wrap(Box::new(|| {}) as Box<FnMut()>);
drop(x);
let x = Closure::wrap(Box::new(|| {}) as Box<FnMut()>);
x.forget();
}

0 comments on commit a68cdc5

Please sign in to comment.