mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-04 11:21:06 +00:00
Refactor inheritance checks into their own tests
This commit is contained in:
parent
1762b3cba0
commit
b330bd1bf1
@ -35,6 +35,13 @@ fn collator() {
|
|||||||
|
|
||||||
let a = Intl::Collator::supported_locales_of(&locales, &opts);
|
let a = Intl::Collator::supported_locales_of(&locales, &opts);
|
||||||
assert!(a.is_instance_of::<Array>());
|
assert!(a.is_instance_of::<Array>());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen_test]
|
||||||
|
fn collator_inheritance() {
|
||||||
|
let locales = Array::of1(&JsValue::from("en-US"));
|
||||||
|
let opts = Object::new();
|
||||||
|
let c = Intl::Collator::new(&locales, &opts);
|
||||||
|
|
||||||
assert!(c.is_instance_of::<Intl::Collator>());
|
assert!(c.is_instance_of::<Intl::Collator>());
|
||||||
assert!(c.is_instance_of::<Object>());
|
assert!(c.is_instance_of::<Object>());
|
||||||
@ -54,6 +61,13 @@ fn date_time_format() {
|
|||||||
|
|
||||||
let a = Intl::DateTimeFormat::supported_locales_of(&locales, &opts);
|
let a = Intl::DateTimeFormat::supported_locales_of(&locales, &opts);
|
||||||
assert!(a.is_instance_of::<Array>());
|
assert!(a.is_instance_of::<Array>());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen_test]
|
||||||
|
fn date_time_format_inheritance() {
|
||||||
|
let locales = Array::of1(&JsValue::from("en-US"));
|
||||||
|
let opts = Object::new();
|
||||||
|
let c = Intl::DateTimeFormat::new(&locales, &opts);
|
||||||
|
|
||||||
assert!(c.is_instance_of::<Intl::DateTimeFormat>());
|
assert!(c.is_instance_of::<Intl::DateTimeFormat>());
|
||||||
assert!(c.is_instance_of::<Object>());
|
assert!(c.is_instance_of::<Object>());
|
||||||
@ -72,6 +86,13 @@ fn number_format() {
|
|||||||
|
|
||||||
let a = Intl::NumberFormat::supported_locales_of(&locales, &opts);
|
let a = Intl::NumberFormat::supported_locales_of(&locales, &opts);
|
||||||
assert!(a.is_instance_of::<Array>());
|
assert!(a.is_instance_of::<Array>());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen_test]
|
||||||
|
fn number_format_inheritance() {
|
||||||
|
let locales = Array::of1(&JsValue::from("en-US"));
|
||||||
|
let opts = Object::new();
|
||||||
|
let n = Intl::NumberFormat::new(&locales, &opts);
|
||||||
|
|
||||||
assert!(n.is_instance_of::<Intl::NumberFormat>());
|
assert!(n.is_instance_of::<Intl::NumberFormat>());
|
||||||
assert!(n.is_instance_of::<Object>());
|
assert!(n.is_instance_of::<Object>());
|
||||||
@ -89,6 +110,13 @@ fn plural_rules() {
|
|||||||
|
|
||||||
let a = Intl::PluralRules::supported_locales_of(&locales, &opts);
|
let a = Intl::PluralRules::supported_locales_of(&locales, &opts);
|
||||||
assert!(a.is_instance_of::<Array>());
|
assert!(a.is_instance_of::<Array>());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen_test]
|
||||||
|
fn plural_rules_inheritance() {
|
||||||
|
let locales = Array::of1(&JsValue::from("en-US"));
|
||||||
|
let opts = Object::new();
|
||||||
|
let r = Intl::PluralRules::new(&locales, &opts);
|
||||||
|
|
||||||
assert!(r.is_instance_of::<Intl::PluralRules>());
|
assert!(r.is_instance_of::<Intl::PluralRules>());
|
||||||
assert!(r.is_instance_of::<Object>());
|
assert!(r.is_instance_of::<Object>());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user