65 Commits

Author SHA1 Message Date
Yusuke Suzuki
fc6a9169a4 Update Intl.Locale info API test
weekendStart / weekendEnd are merged into one weekend array.
2021-11-30 14:36:01 -05:00
Mike Pennisi
347b651e95 Improve coverage for Intl Locale Info proposal 2021-07-21 13:43:57 -04:00
Ujjwal Sharma
26cf753e74
intl402: add output tests for locale-info (#3007)
* intl402: locale-info tests for array output

* fixup! intl402: locale-info tests for array output

* fixup! intl402: locale-info tests for array output
2021-06-24 13:20:47 -04:00
Ujjwal Sharma
5e0fc43c66
Add basic tests for proposal-intl-locale-info (#2987)
* Add basic tests for weekInfo

* Add basic tests for textInfo

* Add basic tests for timeZones

* Add basic tests for numberingSystems

* Add basic tests for hourCycles

* Add basic tests for collations

* Add basic tests for calendars

* Add feature for Intl.Locale-info

* add validation to branding tests for locale-info

Add additional assertion to branding tests for proposal-intl-locale-info
to make sure they don't pass spuriously when the proposal is not
implemented.
2021-05-18 22:40:08 -04:00
Frank Yung-Fong Tang
b2e9dff281 change cel-gaulish map to xtg 2020-12-21 10:15:14 -05:00
Frank Yung-Fong Tang
7c9480476e Update the test based on v35 of UTS35
see http://unicode.org/reports/tr35/#LocaleId_Canonicalization
@anba
2020-12-21 10:15:14 -05:00
Frank Yung-Fong Tang
483219a596 fix mapping for cel-gaulish 2020-12-16 11:59:06 -05:00
Jeff Walden
2cfccb765a Add tests verifying that duplicate variants, in a tag or in the tlang component of a tag, make it structurally invalid. 2020-10-09 16:34:33 -04:00
Frank Yung-Fong Tang
850c65317f Revert "Correct the expectation of zh-Hant"
This reverts commit e8dfe549a886bf66cab86a2e715055e143a8a286.
2020-04-29 17:22:28 -04:00
Frank Yung-Fong Tang
e8dfe549a8 Correct the expectation of zh-Hant
It is incorrect to expect the minimize result of "zh-Hant" to be "zh-TW". It should be "zh-Hant". Why?

first, what we have in input for zh-Hant
lang = zh
region = [none]
script = Hant 

Now, look at the AddLikelySubtags algorithm in http://www.unicode.org/reports/tr35/#Likely_Subtags
2020-04-25 18:52:46 -04:00
Jeff Walden
31dabb5618 Add a test for Unicode key-type pairs being canonicalized by Intl.Locale regardless whether they're passed in the input tag, or through the options object. 2020-04-23 10:49:48 -04:00
André Bargull
18bb955771 Upstream additional language tag canonicalisation and Intl.Locale tests from SpiderMonkey
Adds more canonicalisation and Intl.Locale tests from:
- https://hg.mozilla.org/mozilla-central/file/tip/js/src/tests/non262/Intl/Locale
- https://hg.mozilla.org/mozilla-central/file/tip/js/src/tests/non262/Intl/
2020-04-09 09:20:55 -04:00
André Bargull
5d8e6c8e85 Restore grandfathered tests removed in #2054
With the move to UTS 35 for language tag processing, the expected
canonicalisation results for "cel-gaulish" should now be consistent across
implementations.
2020-04-09 09:20:55 -04:00
André Bargull
de02cf4dd5 Re-enable variant subtag canonicalisation in tests
UTS 35 canonicalisation requires to (again) canonicalise variant subtags.
2020-04-09 09:20:55 -04:00
Alexey Shvayka
34cbf0aed2 Add "proto-from-ctor-realm" tests for Intl proposals (#2346)
* Add Intl.Segmenter test

* Add Intl.RelativeTimeFormat test

* Add Intl.Locale test

* Add Intl.ListFormat test
2019-10-08 14:39:52 -04:00
André Bargull
99f75984db Fix expected test values (#2261)
These two slipped through the cracks in #2097:

test/intl402/Intl/getCanonicalLocales/non-iana-canon.js
- Variant subtag canonicalisation is currrently not allowed.

test/intl402/Locale/getters.js
- Only the first "loc.caseFirst" test in this file was updated in #2097.
2019-07-30 10:53:44 -04:00
André Bargull
50331bd641 Correct expected value for Intl.Locale 'caseFirst'
An empty string is expected with the current proposal text.
2019-07-22 02:24:48 -07:00
André Bargull
589ef945fa Sort variants added to grandfathered tag
And add an explanation for a previously removed and now re-added assertion.
2019-07-22 02:12:21 -07:00
André Bargull
e2ad1357c7 Update Intl.Locale tests for UTS 35
constructor-non-iana-canon.js
- Variant subtag canonicalisation is currently no longer present.

constructor-options-region-valid.js
- Digit region codes are now canonicalised.

constructor-tag.js
- Variant subtags are now sorted alphabetically.

likely-subtags-grandfathered.js
- "cmn" is now canonicalised to "zh".
2019-07-22 02:12:17 -07:00
Frank Yung-Fong Tang
565d7d5b7d Remove unreasonable expectation 2019-02-14 15:23:30 -05:00
Frank Yung-Fong Tang
642929b2a3 correct value that matches languageAlias in
Per  https://tc39.github.io/ecma402/#sec-canonicalizelanguagetag
6.2.3 CanonicalizeLanguageTag ( locale )
The CanonicalizeLanguageTag abstract operation returns the canonical and case-regularized form of the locale argument (which must be a String value that is a structurally valid Unicode BCP 47 Locale Identifier as verified by the IsStructurallyValidLanguageTag abstract operation). A conforming implementation shall take the steps specified in the “BCP 47 Language Tag to Unicode BCP 47 Locale Identifier” algorithm, from Unicode Technical Standard #35 LDML § 3.3.1 BCP 47 Language Tag Conversion.

And
http://unicode.org/reports/tr35/#BCP_47_Language_Tag_Conversion
"
2. If the BCP 47 primary language subtag matches the type attribute of a languageAlias element in Supplemental Data, replace the language subtag with the replacement value.
If there are additional subtags in the replacement value, add them to the result, but only if there is no corresponding subtag already in the tag.
"
and
https://www.unicode.org/repos/cldr/trunk/common/supplemental/supplementalMetadata.xml
...
<languageAlias type="aar" replacement="aa" reason="overlong"/>
 <!--  [Afar]  -->
...
<languageAlias type="ces" replacement="cs" reason="overlong"/>
 <!--  [Czech]  -->
...
<languageAlias type="heb" replacement="he" reason="overlong"/>
 <!--  [Hebrew]  -->
2019-02-14 15:07:54 -05:00
Frank Yung-Fong Tang
b30d3013dc Remove getCanonicalLocales 2019-02-14 15:07:31 -05:00
Frank Yung-Fong Tang
8f713575e9 Move testing of getCanonicalLocales out of Locale
Remove all the assertion of result of getCanonicalLocales from Locale directory
and put them under Intl/getCanonicalLocales directory.
2019-02-14 15:07:31 -05:00
Ross Kirsling
a066af90ea Remove errant tab character. (#2058) 2019-02-04 12:03:46 -07:00
Frank Yung-Fong Tang
cc9c773c28 rm deprecated grandfather 'cel-gaulish' 2019-01-30 10:08:13 -05:00
Frank Yung-Fong Tang
b94ef8cbdc rm deprecated grandfather 'cel-gaulish' 2019-01-30 10:08:13 -05:00
Frank Yung-Fong Tang
49c184eb0f Rm deprecated grandfather 'cel-gaulish' from tests 2019-01-30 10:08:13 -05:00
Frank Yung-Fong Tang
dde5d8e546 Fix invalidLanguageTags array 2019-01-30 10:05:07 -05:00
Frank Yung-Fong Tang
9345023d5f move more cases from valid to invalid (#2047)
This is based on UTS35 in the new spec.
2019-01-28 11:55:57 -05:00
Frank Yung-Fong Tang
9495886d18 Change expectation for x- private lang tag (#2046) 2019-01-28 11:55:20 -05:00
Frank Yung-Fong Tang
b7c9c6c78b Remove unsupported irregular grandfathered tags. (#2029) 2019-01-24 12:34:03 -05:00
Frank Yung-Fong Tang
f39faeef87 Add test for 2.1 CanonicalizeLocaleList ( locales ) (#2040)
See https://tc39.github.io/proposal-intl-locale/#sec-canonicalizelocalelist
2019-01-24 12:28:25 -05:00
Frank Yung-Fong Tang
00d280d231 Remove test of extlang and 4 letter language (#2030)
This is due to the fact we now only accept Unicode Locale Identifier in
UTS 35.
2019-01-24 12:23:30 -05:00
Leo Balter
46c557247e Fix more false positives throwing TypeError in functions 2018-12-17 16:45:56 -05:00
Rick Waldron
3b09d0e2b5 Eliminate false positives: Intl.* 2018-11-30 11:47:57 -05:00
André Bargull
faed4fb089 Fix various test issues 2018-10-17 07:45:33 -07:00
Adrian Heine né Lang
2234f0fc40 Fix syntax in test (#1841)
This was introduced in 6581e84949eb0db1a97513098c1413be433419ee.
2018-10-09 11:29:32 -04:00
Frank Tang
0866789361 numeric should be a boolean not a string 2018-10-05 18:43:50 -07:00
Rick Waldron
6581e84949 Intl.Locale: constructor-options-*.js fixups (#1798) 2018-10-03 10:24:38 -04:00
Frank Tang
5de1831c48 Remove "ar-ma-u-ca-islamicc" test 2018-10-02 14:50:45 -04:00
Rick Waldron
37190a1deb Intl.Locale.prototype.numeric: the feature is not optional, therefore the tests are not optional 2018-09-26 11:06:03 -04:00
Ms2ger
584b651edf Intl.Locale: Expect boolean values from the numeric getter.
The spec changed in <https://github.com/tc39/proposal-intl-locale/pull/59>.
2018-09-26 11:03:22 -04:00
Ms2ger
5b0f7e19db Intl.Locale: Refactor the tests for the numeric option. 2018-09-26 11:02:40 -04:00
Kevin Gibbons
89ec038cf2 remove some trailing commas in calls 2018-09-21 10:04:33 -04:00
Ms2ger
9271068a83 Intl: Add tests for throwing getters in options objects. 2018-09-18 11:39:47 -04:00
Ms2ger
c52f9cb769 Intl: Add tests for subclassing Locale, ListFormat and RelativeTimeFormat.
Fixes #1705.
2018-09-07 15:53:10 +02:00
André Bargull
06c2f01901 Fix multiple test bugs and remove incomplete or no longer valid tests (#1616) 2018-06-29 18:52:53 -04:00
Ms2ger
a6c1d05ac4 Add some additional tests for @@toStringTag on Intl.Locale. (#1604) 2018-06-26 14:43:05 -04:00
Ms2ger
650adc13bf Intl.Locale: Update expectation for empty values for collation and numberingSystem.
The spec changed in https://github.com/tc39/proposal-intl-locale/pull/47.

The tests for calendar were already correct.
2018-06-13 09:43:08 +02:00
Rick Waldron
f71ce6d29a
Merge pull request #1585 from Ms2ger/Locale-branding
Add tests for branding checks in Intl.Locale.prototype members.
2018-06-04 17:01:15 -04:00