blob: 5e4b3faa48650957b6bf5dec2fc5eaa9211cf2c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
use js_sys::*;
use wasm_bindgen::JsCast;
use wasm_bindgen::JsValue;
use wasm_bindgen_test::*;
#[allow(deprecated)]
#[wasm_bindgen_test]
fn new_undefined() {
assert_eq!(Boolean::new(&JsValue::undefined()).value_of(), false);
}
#[allow(deprecated)]
#[wasm_bindgen_test]
fn new_truely() {
assert_eq!(Boolean::new(&JsValue::from("foo")).value_of(), true);
}
#[allow(deprecated)]
#[wasm_bindgen_test]
fn boolean_inheritance() {
let b = Boolean::new(&JsValue::from(true));
assert!(b.is_instance_of::<Boolean>());
assert!(b.is_instance_of::<Object>());
let _: &Object = b.as_ref();
}
|