Skip to content

Commit

Permalink
Merge pull request #193 from sabify/currency
Browse files Browse the repository at this point in the history
chore: update currency tests based on current currency codes
  • Loading branch information
Baptistemontan authored Feb 12, 2025
2 parents d99b3eb + b7656b0 commit 1cb028e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/json/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"datetime_formatting": "{{ date, datetime }}",
"number_formatting": "{{ num, number }}",
"number_formatting_grouping": "{{ num, number(grouping_strategy: never) }}",
"currency_formatting": "{{ num, currency(currency_code: FRA) }}",
"currency_formatting": "{{ num, currency(currency_code: EUR) }}",
"currency_formatting_width": "{{ num, currency(width: narrow; currency_code: USD) }}",
"cardinal_plural_one": "one item",
"cardinal_plural_other": "{{ count }} items",
Expand Down
2 changes: 1 addition & 1 deletion tests/json/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"number_formatting": "{{ num, number }}",
"number_formatting_grouping": "{{ num, number(grouping_strategy: never) }}",
"currency_formatting": "{{ num, currency(currency_code: USD) }}",
"currency_formatting_width": "{{ num, currency(width: narrow; country_code: FRA) }}",
"currency_formatting_width": "{{ num, currency(width: narrow; country_code: EUR) }}",
"cardinal_plural": "{{ count }}",
"ordinal_plural_ordinal_one": "{{ count }}re place",
"ordinal_plural_ordinal_other": "{{ count }}e place",
Expand Down
4 changes: 2 additions & 2 deletions tests/json/src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ fn currency_formatting() {
let num = move || FixedDecimal::from(200050).multiplied_pow10(-2);

let en = td!(Locale::en, currency_formatting, num);
assert_eq_rendered!(en, "FRA\u{a0}2000.50");
assert_eq_rendered!(en, "2000.50");
let fr = td!(Locale::fr, currency_formatting, num);
assert_eq_rendered!(fr, "2000.50\u{a0}$US");

let num = move || 2000.50f64;

let en = td!(Locale::en, currency_formatting, num);
assert_eq_rendered!(en, "FRA\u{a0}2000.5");
assert_eq_rendered!(en, "2000.5");
let fr = td!(Locale::fr, currency_formatting, num);
assert_eq_rendered!(fr, "2000.5\u{a0}$US");

Expand Down

0 comments on commit 1cb028e

Please sign in to comment.