Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
28
third-party/vendor/wasm-bindgen/tests/wasm/truthy_falsy.rs
vendored
Normal file
28
third-party/vendor/wasm-bindgen/tests/wasm/truthy_falsy.rs
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn test_is_truthy() {
|
||||
assert!(!JsValue::from(0).is_truthy());
|
||||
assert!(!JsValue::from("".to_string()).is_truthy());
|
||||
assert!(!JsValue::from(false).is_truthy());
|
||||
assert!(!JsValue::NULL.is_truthy());
|
||||
assert!(!JsValue::UNDEFINED.is_truthy());
|
||||
|
||||
assert!(JsValue::from(10).is_truthy());
|
||||
assert!(JsValue::from("null".to_string()).is_truthy());
|
||||
assert!(JsValue::from(true).is_truthy());
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn test_is_falsy() {
|
||||
assert!(JsValue::from(0).is_falsy());
|
||||
assert!(JsValue::from("".to_string()).is_falsy());
|
||||
assert!(JsValue::from(false).is_falsy());
|
||||
assert!(JsValue::NULL.is_falsy());
|
||||
assert!(JsValue::UNDEFINED.is_falsy());
|
||||
|
||||
assert!(!JsValue::from(10).is_falsy());
|
||||
assert!(!JsValue::from("null".to_string()).is_falsy());
|
||||
assert!(!JsValue::from(true).is_falsy());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue