Skip to content

Commit

Permalink
Improve units format tests (#5234)
Browse files Browse the repository at this point in the history
  • Loading branch information
younies authored Jul 12, 2024
1 parent e5454d2 commit 74c773b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/experimental/src/dimension/units/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ fn test_basic() {

let test_cases = [
(
locale!("en-US").into(),
locale!("en-US"),
"meter",
"12345.67",
UnitsFormatterOptions::default(),
"12,345.67 m",
),
(
locale!("en-US").into(),
locale!("en-US"),
"century",
"12345.67",
UnitsFormatterOptions {
Expand All @@ -82,14 +82,14 @@ fn test_basic() {
"12,345.67 centuries",
),
(
locale!("de-DE").into(),
locale!("de-DE"),
"meter",
"12345.67",
UnitsFormatterOptions::default(),
"12.345,67 m",
),
(
locale!("ar-EG").into(),
locale!("ar-EG"),
"meter",
"12345.67",
UnitsFormatterOptions {
Expand All @@ -101,7 +101,7 @@ fn test_basic() {
];

for (locale, unit, value, options, expected) in test_cases {
let fmt = UnitsFormatter::try_new(&locale, unit, options).unwrap();
let fmt = UnitsFormatter::try_new(&locale.into(), unit, options).unwrap();
let value = value.parse().unwrap();
assert_writeable_eq!(fmt.format_fixed_decimal(&value, unit), expected);
}
Expand Down

0 comments on commit 74c773b

Please sign in to comment.