From 2bb486d257554fa24f9f412d29f80efda634ac16 Mon Sep 17 00:00:00 2001 From: Filip Filmar Date: Sun, 25 Jan 2026 08:43:08 +0000 Subject: [PATCH] fix: move some test cases from sr-RS to nl-NL The rules for `nl-NL` are more stable across ICU versions, so I'd prefer to not have to introduce version-specific tests and keep the specific locale. --- rust_icu_unum/src/lib.rs | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/rust_icu_unum/src/lib.rs b/rust_icu_unum/src/lib.rs index db358c4e..e86ff4b3 100644 --- a/rust_icu_unum/src/lib.rs +++ b/rust_icu_unum/src/lib.rs @@ -771,10 +771,10 @@ mod tests { let tests = vec![ TestCase { - locale: "sr-RS", + locale: "nl-NL", number: 42, style: sys::UNumberFormatStyle::UNUM_CURRENCY, - expected: "42\u{a0}RSD", + expected: "€\u{a0}42,00", }, TestCase { locale: "sr-RS", @@ -808,22 +808,30 @@ mod tests { } let tests = vec![TestCase { - locale: "sr-RS", + locale: "nl-NL", number: 42.1, style: sys::UNumberFormatStyle::UNUM_CURRENCY, - expected: "42\u{a0}RSD", + expected: "€\u{a0}42,10", expected_iter: vec![ - // "42" UFieldPositionType { - field_type: 0, + field_type: 7, begin_index: 0, - past_end_index: 2, + past_end_index: 1, }, - // "RSD" UFieldPositionType { - field_type: 7, - begin_index: 3, - past_end_index: 6, + field_type: 0, + begin_index: 2, + past_end_index: 4, + }, + UFieldPositionType { + field_type: 2, + begin_index: 4, + past_end_index: 5, + }, + UFieldPositionType { + field_type: 1, + begin_index: 5, + past_end_index: 7, }, ], }]; @@ -854,10 +862,10 @@ mod tests { } let tests = vec![TestCase { - locale: "sr-RS", + locale: "nl-NL", number: "1300.55", style: sys::UNumberFormatStyle::UNUM_CURRENCY, - expected: "1.301\u{a0}RSD", + expected: "€\u{a0}1.300,55", }]; for test in tests { let locale = uloc::ULoc::try_from(test.locale).expect("locale exists");