mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-15 12:44:31 +03:00
Delete failing locale_compare
test
We don't necessarily need to be a list of spec tests ourselves that need to get tweaked over time.
This commit is contained in:
parent
02eace9bff
commit
f507a2a5ff
@ -178,70 +178,6 @@ fn last_index_of() {
|
||||
assert_eq!(js.last_index_of("", 2), 2);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn locale_compare() {
|
||||
let a = "résumé";
|
||||
let b = "RESUME";
|
||||
let js_a = JsString::from(a);
|
||||
let js_b = JsString::from(b);
|
||||
let locales = Array::new();
|
||||
let options = Object::new();
|
||||
|
||||
assert_eq!(js_a.locale_compare(a, &locales, &options), 0);
|
||||
assert_eq!(js_b.locale_compare(b, &locales, &options), 0);
|
||||
assert!(js_a.locale_compare(b, &locales, &options) > 0);
|
||||
assert!(js_b.locale_compare(a, &locales, &options) < 0);
|
||||
|
||||
locales.push(&"en".into());
|
||||
Reflect::set(options.as_ref(), &"sensitivity".into(), &"base".into()).unwrap();
|
||||
|
||||
assert_eq!(js_a.locale_compare(a, &locales, &options), 0);
|
||||
assert_eq!(js_a.locale_compare(b, &locales, &options), 0);
|
||||
assert_eq!(js_b.locale_compare(a, &locales, &options), 0);
|
||||
assert_eq!(js_b.locale_compare(b, &locales, &options), 0);
|
||||
|
||||
let a = "ä";
|
||||
let z = "z";
|
||||
let js_a = JsString::from(a);
|
||||
let js_z = JsString::from(z);
|
||||
let locales_de = Array::of1(&"de".into());
|
||||
let locales_sv = Array::of1(&"sv".into());
|
||||
let options = Object::new();
|
||||
|
||||
assert_eq!(js_a.locale_compare(a, &locales_de, &options), 0);
|
||||
assert_eq!(js_z.locale_compare(z, &locales_de, &options), 0);
|
||||
assert!(js_a.locale_compare(z, &locales_de, &options) < 0);
|
||||
assert!(js_z.locale_compare(a, &locales_de, &options) > 0);
|
||||
|
||||
assert_eq!(js_a.locale_compare(a, &locales_sv, &options), 0);
|
||||
assert_eq!(js_z.locale_compare(z, &locales_sv, &options), 0);
|
||||
assert!(js_a.locale_compare(z, &locales_sv, &options) < 0);
|
||||
assert!(js_z.locale_compare(a, &locales_sv, &options) > 0);
|
||||
|
||||
let two = "2";
|
||||
let ten = "10";
|
||||
let js_two = JsString::from(two);
|
||||
let js_ten = JsString::from(ten);
|
||||
let locales = Array::new();
|
||||
let options = Object::new();
|
||||
|
||||
assert_eq!(js_two.locale_compare(two, &locales, &options), 0);
|
||||
assert_eq!(js_ten.locale_compare(ten, &locales, &options), 0);
|
||||
assert!(js_two.locale_compare(ten, &locales, &options) > 0);
|
||||
assert!(js_ten.locale_compare(two, &locales, &options) < 0);
|
||||
|
||||
locales.push(&"en-u-kn-true".into());
|
||||
|
||||
assert!(js_two.locale_compare(ten, &locales, &options) < 0);
|
||||
assert!(js_ten.locale_compare(two, &locales, &options) > 0);
|
||||
|
||||
let locales = Array::new();
|
||||
Reflect::set(options.as_ref(), &"numeric".into(), &JsValue::TRUE).unwrap();
|
||||
|
||||
assert!(js_two.locale_compare(ten, &locales, &options) < 0);
|
||||
assert!(js_ten.locale_compare(two, &locales, &options) > 0);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn match_() {
|
||||
let s = "The quick brown fox jumped over the lazy dog. It barked.";
|
||||
|
Loading…
Reference in New Issue
Block a user