Commit Graph

53 Commits

Author SHA1 Message Date
André Bargull e7024c1761 Disable grouping for numeric units in Intl.DurationFormat 2024-11-07 14:19:18 -08:00
André Bargull 330ecdd016 Sync partitionDurationFormatPattern with latest spec draft
Sync `partitionDurationFormatPattern` with the latest spec draft and
change it to use an `Intl.DurationFormat` object as the input, so it's
easier to compare it against the spec text and because it allows to test
more inputs.

Includes the fixes for:
- https://github.com/tc39/proposal-intl-duration-format/pull/183
- https://github.com/tc39/proposal-intl-duration-format/pull/184
2024-04-23 18:27:01 +02:00
André Bargull 71091f1541 Use simplified PartitionDurationFormatPattern to computed expected results 2023-08-28 16:18:47 +02:00
Frank Yung-Fong Tang 9437cab774 Normative: Add new numbering system "kawi" and "nagm"
Adding tests for https://github.com/tc39/ecma402/pull/714
2023-07-25 10:00:13 +02:00
Timothy Flynn f6c48f333e Update Intl tests to recognize microsecond and nanosecond as sanctioned
These were added to the list of sanctioned units in a normative change:
https://github.com/tc39/ecma402/commit/f627573
2022-11-04 17:30:26 -07:00
Romulo Cintra b458b9f0c2 Update harness/testIntl.js
thks

Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-06-23 16:15:30 -04:00
Romulo Cintra 2877facc4c Update testIntl.js
Add NS digit mappings
2022-06-23 16:15:30 -04:00
Romulo Cintra 0efbba27ff Normative: Add new numbering system "tnsa"
Add [tnsa](https://github.com/unicode-org/cldr/blob/main/common/bcp47/number.xml#L95) to number systems
2022-06-23 16:15:30 -04:00
André Bargull 71460edfeb Add helper functions to retrieve all calendars, collations, numberingSystems, and simple sanctioned units
And then use these helpers to replace hard-coded lists in other tests.
2021-09-08 09:29:06 -04:00
rwaldron 488eb365db chore: migrate $ERROR -> throw new Test262Error in harness/ & test/harness 2021-07-21 15:15:55 -04:00
Frank Yung-Fong Tang 9997a26c7d
Fix tests on {localeMatcher: "lookup"} (#3008)
* Fix test for only {localeMatcher: "lookup"}

The expectation that "sr-Thai-RS" would be returned is only true with the 
9.2.2 BestAvailableLocale ( availableLocales, locale )
https://tc39.es/ecma402/#sec-bestavailablelocale
algorithm used by 9.2.3 LookupMatcher ( availableLocales, requestedLocales )
https://tc39.es/ecma402/#sec-lookupmatcher

The default for localeMatcher is "best fit" but not "lookup" for all Intl objects.

And for 9.2.4 BestFitMatcher ( availableLocales, requestedLocales )
https://tc39.es/ecma402/#sec-bestfitmatcher
It may not match "sr-Thai-RS" for "sr"  and return ["de", "zh-CN"] instead. Therefore, we need to change this test to only test on {localeMatcher: "lookup"}

* Add option to getLocaleSupportInfo

Needed to test different localeMatcher

* only test for "lookup" localeMatcher

* Get the info based on the localeMatcher

* pass in localeMatcher to getLocaleSupportInfo
2021-06-24 13:37:33 -04:00
Frank Yung-Fong Tang f9a834c05e Update testIntl.js 2020-12-16 11:59:06 -05:00
Yusuke Suzuki e8cdf923ef Property clearing code of RegExp constructor is wrong
This code is setting values to $1 etc., which can be non-writable or accessors.
For example, https://github.com/tc39/proposal-regexp-legacy-features/ is specifying them as accessors, and they should throw an error when
it is done in strict code. We should execute `(/(?:)/).test("");` to clear them.
2020-09-02 15:32:18 -04:00
Frank Tang 3c89cde3e0 Intl.DisplayNames make type required
Update the tests to the latest version after we make
the type option now required

Spec:
https://tc39.es/proposal-intl-displaynames/

Changes of spec:
https://github.com/tc39/proposal-intl-displaynames/pull/76
https://github.com/tc39/proposal-intl-displaynames/pull/83
2020-07-10 19:19:34 -07:00
André Bargull 649d0d2c9a Update list of non-algorithmic numbering systems
Per https://github.com/tc39/ecma402/pull/438
2020-06-24 12:11:36 -04:00
Alexey Shvayka fd90d58f05 Change `alphanum` to character class
Co-Authored-By: Ross Kirsling <rkirsling@gmail.com>
2020-04-29 17:22:05 -04:00
Alexey Shvayka d3b3e5e586 Make `alphanum` a non-capturing group 2020-04-29 17:22:05 -04:00
Alexey Shvayka 4371e3ae36 Remove unnecessary capture group 2020-04-29 17:22:05 -04:00
Alexey Shvayka af05e8e4f7 Revert "Simplify alphanum regex in testIntl.js"
This reverts commit d57bd9d4bd.
2020-04-29 17:22:05 -04:00
Ross Kirsling d57bd9d4bd Simplify alphanum regex in testIntl.js 2020-04-23 10:47:32 -04:00
André Bargull a52517464f Add Unicode and Transformed extension canonicalisation
Generated using the make_intl_data.py script.
2020-04-09 09:20:55 -04:00
André Bargull 1c93566e66 Update language tag mappings to CLDR 36.1
Generated using the make_intl_data.py script.
2020-04-09 09:20:55 -04:00
André Bargull 756ee6a171 Update list of numbering systems 2020-04-09 09:20:55 -04:00
André Bargull 7556d59fe7 Update list of Intl service constructors
Add RelativeTimeFormat, ListFormat, and DisplayNames to the list of Intl
service constructors.
2020-04-09 09:20:55 -04:00
Mike Pennisi a9111d7144 lint: add rule to verify use of harness files
Verify that every test file which references a harness file using the
"includes" directive also contains at least one reference to a value
defined in the harness file.

To support this check, extend each harness file with a list of values
which it defines.
2019-09-25 14:00:50 -04:00
André Bargull c596d9674e Update `canonicalizeLanguageTag` helper to match UTS 35 canonicalisation 2019-07-22 02:12:20 -07:00
André Bargull 1edeb484b8 Include locales supported through fallback when testing fallbacks
This test started failing when updating to ICU 64, because ICU supports "zh"
and "zh-Hans-CN", but not explicitly also "zh-Hans", which is required for this
test to pass. The same kind of error is reproducible with ICU <64 when "Guru"
is added to the list of script codes in 'testIntl.js', because ICU supports
"pa-Guru-IN", but "pa-IN" isn't explicitly supported, too.

So, change this test to also check 'byFallback' to see if a locale is supported.

Drive-by change:
- Modernise the test to make it more readable how subtags are combined.
- Also add "419" to the list of region codes to cover the digit region syntax.
2019-07-22 02:12:05 -07:00
André Bargull f7e8dba39b Update tests to parse language tags as Unicode BCP 47 Locale Identifiers
harness/testIntl.js
- Add now invalid tags to getInvalidLanguageTags, these tags were previously used in test files changed in this commit.
- Update isCanonicalizedStructurallyValidLanguageTag regular expressions.

test/intl402/Intl/getCanonicalLocales/canonicalized-tags.js
- Moved five now invalid tags to getInvalidLanguageTags function in testIntl.js

test/intl402/Intl/getCanonicalLocales/preferred-grandfathered.js
- All irregular grandfathered tags are invalid now
- Regular grandfathered with extlang subtags are now also invalid
- Regular grandfathered with variant-like subtags are still valid

test/intl402/Intl/getCanonicalLocales/weird-cases.js
- Revert changes from last commit
- "x-u-foo" is now invalid and was moved to getInvalidLanguageTags function

test/intl402/ListFormat/constructor/constructor/locales-valid.js
test/intl402/RelativeTimeFormat/constructor/constructor/locales-valid.js
test/intl402/Segmenter/constructor/constructor/locales-valid.js
- Irregular grandfathered and privateuse only are no longer valid language tags

test/intl402/language-tags-canonicalized.js
- Same changes as in test/intl402/Intl/getCanonicalLocales/canonicalized-tags.js

test/intl402/language-tags-invalid.js
- Invalid tags list in this file was a subset of getInvalidLanguageTags, so replaced with getInvalidLanguageTags to get more coverage

test/intl402/language-tags-valid.js
- Same changes as in test/intl402/Intl/getCanonicalLocales/canonicalized-tags.js
2019-07-21 05:44:21 -07:00
Ms2ger 4986474fd1 Intl: Add an overlong language to getInvalidLocaleArguments(). 2018-10-26 16:48:40 -04:00
Ms2ger b4efa8c938 Add tests for the shape of the Intl.RelativeTimeFormat API. (#1596)
* Add Intl.RelativeTimeFormat feature.

* Add tests for the shape of the Intl.RelativeTimeFormat API.

* fixup! Add tests for the shape of the Intl.RelativeTimeFormat API.
2018-06-26 14:02:29 -04:00
Rick Waldron 253bc87bc5
Merge pull request #1560 from tc39/intl-update-iana-subtags-2018-04-23
Intl: Update language subtag data to "IANA language subtag registry, file date 2018-04-23"
2018-06-04 16:22:01 -04:00
Ms2ger 501a9a674f Various additions to the Intl.Locale test coverage. 2018-06-04 14:08:28 +02:00
Rick Waldron 560d9e519c Intl: Update language subtag data to "IANA language subtag registry, file date 2018-04-23"
https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
2018-05-18 11:54:44 -04:00
Ms2ger 190cf5c730 Extract list of structurally invalid tags from invalid-tags.js. 2018-05-03 14:20:39 -04:00
André Bargull 72db5f1ec1 Replace mustHaveProperty with verifyProperty 2017-12-21 16:46:56 -05:00
André Bargull ce3c3d7dbd Replace mustNotHaveProperty with verifyProperty 2017-12-21 16:46:56 -05:00
André Bargull 20ea611db7 Replace mayHaveProperty with verifyProperty 2017-12-21 16:46:56 -05:00
André Bargull d249979bc9 Update language tag mapping data 2017-12-21 16:46:55 -05:00
André Bargull 2bf5a3ce26 Add numbering system digits for 'bali' and 'limb' 2017-12-21 16:46:55 -05:00
André Bargull 2efacfe368 Update list of numbering systems to match CLDR 32 2017-12-21 16:46:55 -05:00
André Bargull 56323fe2dd Also test Intl.PluralRules if available 2017-12-21 16:46:55 -05:00
André Bargull 48173672f2 Inline testValidDateTimeComponentValue into single test using this function 2017-12-21 16:46:55 -05:00
André Bargull 064ce66a5b Remove unused return value for testOption 2017-12-21 16:46:55 -05:00
André Bargull 52980ef496 Move test data for getLocaleSupportInfo into getLocaleSupportInfo 2017-12-21 16:46:55 -05:00
André Bargull 017fa6d55f Remove caching of getLocaleSupportInfo() return value 2017-12-21 16:46:55 -05:00
André Bargull 123259733b Replace testArraysAreSame with assert.compareArray 2017-12-21 16:46:55 -05:00
André Bargull e65c65c293 Remove unused return value from testWithIntlConstructors 2017-12-21 16:46:55 -05:00
André Bargull f87aeab893 Canada/East-Saskatchewan is no longer a valid time zone identifier (tzdata2017c) 2017-12-21 16:46:55 -05:00
Rick Waldron 4ea2931f16 Update all harness files to pass linting. (#1153)
```
$ python tools/lint/lint.py --whitelist lint.whitelist harness/*.js
Linting 25 files.
Linting complete. 0 errors found.
```

- Renames detachArrayBuffer-$262.detachArrayBuffer.js -> detachArrayBuffer-host-detachArrayBuffer.js (previous naming prevents command-click from terminal)

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-07-14 11:37:24 -04:00
Mathias Bynens a621155bcd Unify indentation and add .editorconfig (#973) 2017-04-13 10:37:32 -04:00