diff --git a/components/calendar/src/islamic.rs b/components/calendar/src/islamic.rs index a83286fd2b8..9a00e00ea04 100644 --- a/components/calendar/src/islamic.rs +++ b/components/calendar/src/islamic.rs @@ -2149,7 +2149,7 @@ mod test { } } - #[ignore] + #[ignore] // slow #[test] fn test_days_in_provided_year_observational() { let calendar = IslamicObservational::new(); @@ -2179,7 +2179,7 @@ mod test { ); } - #[ignore] + #[ignore] // slow #[test] fn test_days_in_provided_year_ummalqura() { let calendar = IslamicUmmAlQura::new(); diff --git a/components/collator/tests/tests.rs b/components/collator/tests/tests.rs index 731f84616b2..38152445f03 100644 --- a/components/collator/tests/tests.rs +++ b/components/collator/tests/tests.rs @@ -622,16 +622,12 @@ fn test_ja_chooon_kigoo() { } } -// TODO: This test should eventually test fallback // TODO: Test Swedish and Chinese also, since they have unusual // variant defaults. (But are currently not part of the test data.) -#[ignore] #[test] fn test_region_fallback() { // There's no explicit fi-FI data. - let locale: Locale = "fi-u-co-standard".parse().unwrap(); - - // let locale = locale!("fi-FI").into(); + let locale = locale!("fi-FI"); let collator = Collator::try_new(&locale.into(), CollatorOptions::new()).unwrap(); assert_eq!(collator.compare("ä", "z"), Ordering::Greater); @@ -694,8 +690,8 @@ fn test_vi() { } } -#[ignore] #[test] +// See DatagenProvider test_zh_non_baked for gb2312 and big5han tests fn test_zh() { // Note: ㄅ is Bopomofo. @@ -735,20 +731,6 @@ fn test_zh() { assert_eq!(collator.compare("佰", "ㄅ"), Ordering::Less); assert_eq!(collator.compare("不", "把"), Ordering::Greater); } - { - let locale: Locale = "zh-u-co-gb2312".parse().unwrap(); - let collator = Collator::try_new(&locale.into(), CollatorOptions::new()).unwrap(); - assert_eq!(collator.compare("艾", "a"), Ordering::Greater); - assert_eq!(collator.compare("佰", "a"), Ordering::Greater); - assert_eq!(collator.compare("ㄅ", "a"), Ordering::Greater); - assert_eq!(collator.compare("ㄅ", "ж"), Ordering::Greater); - assert_eq!(collator.compare("艾", "佰"), Ordering::Less); - // In GB2312 proper, Bopomofo comes before Han, but the - // collation leaves Bopomofo unreordered, so it comes after. - assert_eq!(collator.compare("艾", "ㄅ"), Ordering::Less); - assert_eq!(collator.compare("佰", "ㄅ"), Ordering::Less); - assert_eq!(collator.compare("不", "把"), Ordering::Greater); - } { let locale: Locale = "zh-u-co-stroke".parse().unwrap(); let collator = Collator::try_new(&locale.into(), CollatorOptions::new()).unwrap(); @@ -785,18 +767,6 @@ fn test_zh() { assert_eq!(collator.compare("佰", "ㄅ"), Ordering::Less); assert_eq!(collator.compare("不", "把"), Ordering::Less); } - { - let locale: Locale = "zh-u-co-big5han".parse().unwrap(); - let collator = Collator::try_new(&locale.into(), CollatorOptions::new()).unwrap(); - assert_eq!(collator.compare("艾", "a"), Ordering::Greater); - assert_eq!(collator.compare("佰", "a"), Ordering::Greater); - assert_eq!(collator.compare("ㄅ", "a"), Ordering::Greater); - assert_eq!(collator.compare("ㄅ", "ж"), Ordering::Less); - assert_eq!(collator.compare("艾", "佰"), Ordering::Less); - assert_eq!(collator.compare("艾", "ㄅ"), Ordering::Less); - assert_eq!(collator.compare("佰", "ㄅ"), Ordering::Less); - assert_eq!(collator.compare("不", "把"), Ordering::Less); - } // TODO: Test script and region aliases } @@ -1044,7 +1014,6 @@ fn test_tr_primary() { } } -#[ignore] #[test] fn test_lt_tertiary() { let left = [ @@ -1079,7 +1048,6 @@ fn test_lt_tertiary() { } } -#[ignore] #[test] fn test_lt_primary() { let left = ["ž"]; diff --git a/components/datetime/src/helpers.rs b/components/datetime/src/helpers.rs index 5d6b355fc89..bf66e9b6299 100644 --- a/components/datetime/src/helpers.rs +++ b/components/datetime/src/helpers.rs @@ -38,7 +38,7 @@ macro_rules! size_test { }; } #[test] - #[cfg_attr(not(icu4x_run_size_tests), ignore)] + #[cfg_attr(not(icu4x_run_size_tests), ignore)] // Doesn't work on arbitrary Rust versions fn $id() { let size = core::mem::size_of::<$ty>(); let success = match option_env!("CI_TOOLCHAIN") { @@ -67,7 +67,7 @@ macro_rules! size_test { }; } #[test] - #[cfg_attr(not(icu4x_run_size_tests), ignore)] + #[cfg_attr(not(icu4x_run_size_tests), ignore)] // Doesn't work on arbitrary Rust versions fn $id() { let size = core::mem::size_of::<$ty>(); let expected = $size; diff --git a/components/experimental/src/personnames/specifications/derive_missing_initials.rs b/components/experimental/src/personnames/specifications/derive_missing_initials.rs index 0cd8fcbd0bd..21ec54e722d 100644 --- a/components/experimental/src/personnames/specifications/derive_missing_initials.rs +++ b/components/experimental/src/personnames/specifications/derive_missing_initials.rs @@ -110,7 +110,6 @@ mod tests { } #[test] - #[ignore] // not clear from the spec whether this test is correct fn test_multi_3_initial_should_still_only_be_2() -> Result<(), PersonNamesFormatterError> { let mut person_data = LiteMap::new(); person_data.insert( @@ -127,7 +126,9 @@ mod tests { }; let result = super::derive_missing_initials(&person_name, &requested_field, "{0}.", "{0} {1}"); - assert_eq!(result, "M. J."); + + // TODO(#3077): broken, this should be equal + assert_ne!(result, "M. J."); Ok(()) } } diff --git a/components/segmenter/tests/css_word_break.rs b/components/segmenter/tests/css_word_break.rs index 7137d10b62c..f7d62ef187a 100644 --- a/components/segmenter/tests/css_word_break.rs +++ b/components/segmenter/tests/css_word_break.rs @@ -154,7 +154,7 @@ fn wordbreak_keepall() { } #[test] -#[cfg_attr(not(feature = "lstm"), ignore)] +#[cfg(feature = "lstm")] fn wordbreak_keepall_lstm() { // from css/css-text/word-break/word-break-keep-all-003.html let s = "และและ"; diff --git a/provider/bikeshed/src/collator/mod.rs b/provider/bikeshed/src/collator/mod.rs index 093b2561319..4038e541d94 100644 --- a/provider/bikeshed/src/collator/mod.rs +++ b/provider/bikeshed/src/collator/mod.rs @@ -285,3 +285,48 @@ collation_provider!( ), toml_data ); + +#[test] + +fn test_zh_non_baked() { + use core::cmp::Ordering; + use icu::collator::{Collator, CollatorOptions}; + use icu_provider_adapters::fallback::LocaleFallbackProvider; + + let provider = + LocaleFallbackProvider::try_new_unstable(DatagenProvider::new_testing()).unwrap(); + + // Note: ㄅ is Bopomofo. + { + let locale = "zh-u-co-gb2312".parse().unwrap(); + let collator = + Collator::try_new_unstable(&provider, &locale, CollatorOptions::new()).unwrap(); + assert_eq!(collator.compare("艾", "a"), Ordering::Greater); + assert_eq!(collator.compare("佰", "a"), Ordering::Greater); + assert_eq!(collator.compare("ㄅ", "a"), Ordering::Greater); + assert_eq!(collator.compare("ㄅ", "ж"), Ordering::Greater); + + // TODO(#5136): broken, these should be equal + assert_ne!(collator.compare("艾", "佰"), Ordering::Less); + // In GB2312 proper, Bopomofo comes before Han, but the + // collation leaves Bopomofo unreordered, so it comes after. + assert_ne!(collator.compare("艾", "ㄅ"), Ordering::Less); + assert_ne!(collator.compare("佰", "ㄅ"), Ordering::Less); + assert_ne!(collator.compare("不", "把"), Ordering::Greater); + } + { + let locale = "zh-u-co-big5han".parse().unwrap(); + let collator = + Collator::try_new_unstable(&provider, &locale, CollatorOptions::new()).unwrap(); + assert_eq!(collator.compare("艾", "a"), Ordering::Greater); + assert_eq!(collator.compare("佰", "a"), Ordering::Greater); + assert_eq!(collator.compare("ㄅ", "a"), Ordering::Greater); + assert_eq!(collator.compare("不", "把"), Ordering::Less); + + // TODO(#5136): broken, these should be equal + assert_ne!(collator.compare("ㄅ", "ж"), Ordering::Less); + assert_ne!(collator.compare("艾", "佰"), Ordering::Less); + assert_ne!(collator.compare("艾", "ㄅ"), Ordering::Less); + assert_ne!(collator.compare("佰", "ㄅ"), Ordering::Less); + } +}