| 1 |
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <[email protected]> |
| 2 |
Date: Tue, 1 Feb 2022 14:32:19 +0100 |
| 3 |
Subject: tests: Ignore POSIX/posix mismatch in tests |
| 4 |
|
| 5 |
We consider the two variants as different while it's actually the same. |
| 6 |
--- |
| 7 |
js/src/tests/non262/Intl/available-locales-resolved.js | 2 +- |
| 8 |
js/src/tests/non262/Intl/available-locales-supported.js | 3 +++ |
| 9 |
2 files changed, 4 insertions(+), 1 deletion(-) |
| 10 |
|
| 11 |
diff --git a/js/src/tests/non262/Intl/available-locales-resolved.js b/js/src/tests/non262/Intl/available-locales-resolved.js |
| 12 |
index 76b144d..38f5dd7 100644 |
| 13 |
--- a/js/src/tests/non262/Intl/available-locales-resolved.js |
| 14 |
+++ b/js/src/tests/non262/Intl/available-locales-resolved.js |
| 15 |
@@ -33,7 +33,7 @@ for (let intlConstructor of intlConstructors) { |
| 16 |
|
| 17 |
// If |locale| is an available locale, the "lookup" locale matcher should |
| 18 |
// pick exactly that locale. |
| 19 |
- assertEq(resolved.locale, locale); |
| 20 |
+ assertEq(resolved.locale, locale.replace(/-(POSIX|posix)$/, '')); |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
diff --git a/js/src/tests/non262/Intl/available-locales-supported.js b/js/src/tests/non262/Intl/available-locales-supported.js |
| 25 |
index d11b5d7..b28f17e 100644 |
| 26 |
--- a/js/src/tests/non262/Intl/available-locales-supported.js |
| 27 |
+++ b/js/src/tests/non262/Intl/available-locales-supported.js |
| 28 |
@@ -17,6 +17,9 @@ for (let intlConstructor of intlConstructors) { |
| 29 |
// Retrieve all available locales of the given Intl service constructor. |
| 30 |
let available = getAvailableLocalesOf(intlConstructor.name); |
| 31 |
|
| 32 |
+ for (let i = 0; i < available.length; i++) |
| 33 |
+ available[i] = available[i].replace('POSIX', 'posix'); |
| 34 |
+ |
| 35 |
// All available locales must be reported as supported. |
| 36 |
let supported = intlConstructor.supportedLocalesOf(available); |
| 37 |
assertEqArray(supported, available); |