diff options
author | Victor Chang <vichang@google.com> | 2024-04-19 18:21:46 +0100 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2024-04-19 21:57:14 +0000 |
commit | 77d967c6f0d7108a7c299761b4c73660b3ec4a5b (patch) | |
tree | 872f7a758bf47e69c4dd32950b5a346e34fe38d2 | |
parent | 49ec0aef6827cca609000e7213f50f3774ae9cec (diff) | |
download | libcore-77d967c6f0d7108a7c299761b4c73660b3ec4a5b.tar.gz |
Update CurrencyTest due to ICU 75
Curaçao and Sint Maarten are replacing ANG (Netherland
Antillean Guilder) with XCG (Caribbean Guilder).
Bug: 320769332
Test: CtsLibcoreTestCases
Change-Id: Id6513bef6aea4375e692c10582711182f4233484
-rw-r--r-- | luni/src/test/java/libcore/highmemorytest/java/util/CurrencyTest.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/luni/src/test/java/libcore/highmemorytest/java/util/CurrencyTest.java b/luni/src/test/java/libcore/highmemorytest/java/util/CurrencyTest.java index e31030205dc..3467ced0583 100644 --- a/luni/src/test/java/libcore/highmemorytest/java/util/CurrencyTest.java +++ b/luni/src/test/java/libcore/highmemorytest/java/util/CurrencyTest.java @@ -45,14 +45,23 @@ public class CurrencyTest { @Test public void test_currencyCodeIcuConsistency() { + String countryCode = locale.getCountry(); // java.util.Currency.getCurrency is time-sensitive. And Croatia doesn't use Euro until // 2023/1/1. https://unicode-org.atlassian.net/browse/CLDR-16061 // We skip the test until Feb 2023. - if ("HR".equals(locale.getCountry()) && + if ("HR".equals(countryCode) && LocalDateTime.of(2023, 2, 1, 0, 0).atZone(ZoneId.of("GMT")).toInstant() .isAfter(Instant.now())) { return; } + // https://unicode-org.atlassian.net/browse/CLDR-17274 + // Effective 2025-03-31, Curaçao and Sint Maarten are replacing ANG (Netherlands + // Antillean Guilder) with XCG (Caribbean Guilder). + if (("CW".equals(countryCode) || "SX".equals(countryCode)) && + LocalDateTime.of(2025, 5, 1, 0, 0).atZone(ZoneId.of("GMT")).toInstant() + .isAfter(Instant.now())) { + return; + } Currency javaCurrency = getCurrency(locale); if (javaCurrency == null) { return; |