2019-06-10 18:46:30 +03:00
|
|
|
use js_sys::Function;
|
2018-09-26 18:26:00 +03:00
|
|
|
use wasm_bindgen_test::*;
|
2018-09-10 21:16:55 +03:00
|
|
|
|
|
|
|
include!(concat!(env!("OUT_DIR"), "/callbacks.rs"));
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
fn multi_op_same_name() {
|
|
|
|
let a = CallbackInterface2::new();
|
|
|
|
let b = TakeCallbackInterface::new().unwrap();
|
|
|
|
b.b(&a);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
fn single_op_function() {
|
|
|
|
let a = Function::new_no_args("");
|
|
|
|
let b = TakeCallbackInterface::new().unwrap();
|
|
|
|
b.a_with_callback(&a);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
fn single_op_dict() {
|
|
|
|
let a = CallbackInterface1::new();
|
|
|
|
let b = TakeCallbackInterface::new().unwrap();
|
|
|
|
b.a_with_callback_interface1(&a);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
fn dict_methods() {
|
|
|
|
let mut a = CallbackInterface1::new();
|
|
|
|
a.foo(&Function::new_no_args(""));
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
fn dict_methods1() {
|
|
|
|
let mut a = CallbackInterface2::new();
|
|
|
|
a.foo(&Function::new_no_args(""));
|
|
|
|
a.bar(&Function::new_no_args(""));
|
|
|
|
}
|