Commit Graph

436 Commits

Author SHA1 Message Date
Frank Yung-Fong Tang 1161eee3e4 use undefined instead of 0 2020-07-09 21:52:54 -04:00
Frank Yung-Fong Tang 36e4278f20 use undefined instead of 0 so range is only 1-3 2020-07-09 21:52:54 -04:00
Frank Yung-Fong Tang 21824359d0 restrict the range from 1 to 3 2020-07-09 21:52:54 -04:00
Frank Yung-Fong Tang e620226cd7 limit the range to 1 to 3 only 2020-07-09 21:52:54 -04:00
Yusuke Suzuki 281eb10b28
Intl.DateTimeFormat.{formatRange,formatRangeToParts} should throw TypeError instead of RangeError if either of parameter is undefined (#2685)
http://tc39.es/proposal-intl-DateTimeFormat-formatRange/
The spec draft throws TypeError instead of RangeError.

	1.4.5 Intl.DateTimeFormat.prototype.formatRange ( startDate , endDate )
	...
	4. If startDate is undefined or endDate is undefined, throw a TypeError exception.

	1.4.6 Intl.DateTimeFormat.prototype.formatRangeToParts ( startDate , endDate )
	...
	4. If startDate is undefined or endDate is undefined, throw a TypeError exception.
2020-07-01 14:45:43 -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
André Bargull 630f7dee66 Updated expected error in NumberFormat constructor per current spec 2020-06-24 12:11:36 -04:00
André Bargull d42aaa4b15 Expect `undefined` when no fractional second digits are present
Change the expected value per the current PR.
2020-06-24 12:11:36 -04:00
Frank Tang 8d3dd2d1a0 Sync the test w/ changes in intl-datetime-style 43
See
https://github.com/tc39/proposal-intl-datetime-style/pull/43
2020-06-17 12:44:31 -04:00
Frank Tang ae0de0b6bb Remove redundant assert 2020-06-10 12:30:58 -04:00
Frank Tang c6fd7eb602 Update Intl.Segmenter to latest spec
Remove methods removed in the latest reversion.

Still need to add tests for:
1.5.2.1 %SegmentsPrototype%.containing ( index )
1.6.2.1 %SegmentIteratorPrototype%.next ()
1.6.2.2 %SegmentIteratorPrototype% [ @@toStringTag ]
2020-06-10 12:30:58 -04:00
Alexey Shvayka ef12a8b11c
Intl: Add coverage for meaningful @@toStringTag values (#2634)
* Add Intl.Collator tests

* Add Intl.DateTimeFormat tests

* Adjust Intl.NumberFormat tests

* Add Intl.PluralRules tests

* Remove now duplicated tests

* Add "toString-changed-tag.js" tests
2020-06-01 15:40:35 -07:00
Frank Yung-Fong Tang 850c65317f Revert "Correct the expectation of zh-Hant"
This reverts commit e8dfe549a8.
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
Frank Yung-Fong Tang c3e980addf correct style-short.js 2020-04-25 18:48:40 -04:00
Frank Yung-Fong Tang df861e4bbc correct style-narrow.js 2020-04-25 18:48:40 -04:00
Frank Yung-Fong Tang d6c1b361c8 style-long.js 2020-04-25 18:48:40 -04:00
Frank Yung-Fong Tang 17fe569a5e correct style-short.js 2020-04-25 18:48:40 -04:00
Frank Yung-Fong Tang 81de828140 correct style-narrow.js 2020-04-25 18:48:40 -04:00
Frank Yung-Fong Tang 79c1818a68 Correct pl-pl*.js test for minimumGroupingDigits
pl has minimumGroupingDigits{"2"} in locale data according to CLDR
therefore there should be no \u00a0 between 1 and 000

Close https://github.com/tc39/test262/issues/2589
2020-04-25 18:48:40 -04:00
Frank Yung-Fong Tang 0942fe16ae correct comments 2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 9b54c22e10 correct comments 2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang aabf688371 correct comment 2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang e72a96572b Change the compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 21440c733c Change compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang fc55e45698 Change the compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 8ad12251ae Change compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 4fb0e70db0 add "fractionalSecondDigits" 2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 9c6ab189b7 Add fractionalSecondDigits
close https://github.com/tc39/test262/issues/2591
2020-04-25 18:43:48 -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
Frank Yung-Fong Tang 064d3c24e3 correct exceptions for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 18f55513f0 correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 7bb81a4ee0 correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 52ec5850d6 correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 6b3b5c100a correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 7aa12918ec correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang fb00de47c0 correct expectation of exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 11cc0c03f9 correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 9119877088 correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 2022f97a25 correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 0fc6784390 correct exceptZero expectation 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 988bf55b25 correct exceptZero expectation 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang e5d4129d37 correct for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 8293c961e9 correct expectation for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 0279d96432 correct cases for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang d4017357d8 correction for exceptZero 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang f07fe8cb1c correct 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang c1a1111972 correct 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 832ecd285f correct 2020-04-23 10:46:27 -04:00
Frank Yung-Fong Tang 940be668ca correct expectation for signDisplay: "exceptZero" 2020-04-23 10:46:27 -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
André Bargull ae8694b4b7 Copy "invalid options" test from RelativeTimeFormat to NumberFormat/DateTimeFormat
The invalid 'numberingSystem' options test from RelativeTimeFormat covers a few
more cases, so let's reuse it for NumberFormat and DateTimeFormat.
While there, also add tests using non-ASCII inputs.

Fixes #2540
2020-03-30 13:58:04 -04:00
Caio Lima 5d5904d69a Adding test cases to verify that 'numberingSystem' and 'calendar' options are being mapped to lower case 2020-02-20 12:33:21 -05:00
Ms2ger 1f7f5ef23c Change the unit in the NumberFormat unit tests.
This ensures https://github.com/tc39/proposal-unified-intl-numberformat/pull/93 is covered.
2020-02-06 11:09:18 -05:00
Caio Lima 6ecaf1f065 Adjusting separator character 2020-02-05 15:11:25 -05:00
Caio Lima 2e6a371f71 Adding missing 'zip' function 2020-02-05 15:11:25 -05:00
Caio Lima 1337f11e21 Adding tests to cover 'fractionalSecondDigits' on DateTimeFormat.prototype.formatRangeToParts. 2020-02-05 15:11:25 -05:00
Caio Lima 04b1d2254b Added tests with invalid values for calendar and numberingSystem (#2480) 2020-01-24 14:21:33 -05:00
Ms2ger 28b4fcca4b Add tests for the numberingSystem option to RelativeTimeFormat. (#2459)
* Add tests for the numberingSystem option to RelativeTimeFormat.

* fixup! Add tests for the numberingSystem option to RelativeTimeFormat.
2020-01-08 16:29:13 -05:00
Ms2ger 87ac236324 Add a specific test for relatedYear output. (#2458)
Based on <https://cs.chromium.org/chromium/src/v8/test/intl/date-format/related-year.js>.

Fixes #2332.
2020-01-08 16:27:39 -05:00
Lo̹̫̦̥̬̜͈͝n̗͚̼̤ĝ̮̫͎̬̬͕̪ͫ̐̕ ͭ̊H̱̏ͬ̃ͨ̆͗o̱͚͉͉̖̰̪ͯ̈ͪ̈̎̚ cd6db88295 Fix toNumber consistency issue with boolean (#2456)
As per https://tc39.es/ecma262/#table-11 `toNumber(false)` is supposed to be `+0`
2020-01-08 16:24:19 -05:00
Ms2ger 2fb0eca404 More tests for Unified NumberFormat. (#2454) 2020-01-08 16:23:01 -05:00
Frank Yung-Fong Tang 31f1bb5a75 Remove date related types for Intl.DisplayNames (#2448) 2019-12-23 13:07:36 -05:00
Frank Yung-Fong Tang 65e996ba81 Check the step 29 of InitializeDateTimeFormat (#2427) 2019-12-02 10:43:53 -05:00
Leo Balter aa9ba4b58f
Add tests for Intl.DisplayNames#resolvedOptions (#2405) 2019-11-13 10:50:18 -05:00
Leo Balter 21195de94c
Inital commit for Intl.DisplayNames tests (#2404) 2019-10-17 10:32:00 -04:00
Ms2ger 4b6efea2c6 Add more tests for DateTimeFormat.hourCycle/hour12. (#2385)
In particular, when using dateStyle/timeStyle.

See also <https://github.com/tc39/proposal-intl-datetime-style/issues/34>.
2019-10-15 12:39:34 -04:00
Frank Yung-Fong Tang 146ef7db57 add features: [Intl.DateTimeFormat-formatRange] (#2403) 2019-10-10 15:27:20 -04:00
Leo Balter 98883a577e
Use canonical format for the description in the metatags (#2401)
Ref #2387
2019-10-10 11:30:26 -04:00
Leo Balter 4182972a49
Merge pull request #2396 from leobalter/2381/yaml
Yaml consistency
2019-10-09 13:29:16 -04:00
Frank Yung-Fong Tang 79591ae6c8 Add test for #349 and #351 PR (#2379)
Test DateTimeFormat change pattern based on calendar and output relatedYear and yearName
based on the assumption that "en-u-ca-chinese" will output 'relatedYear' and 'yearName'.
https://github.com/tc39/ecma402/pull/349
https://github.com/tc39/ecma402/pull/351
@rwaldron @leobalter @Ms2ger @littledan
2019-10-08 14:54:02 -04:00
Leo Balter 2b48ec7a00 More yaml and whitespace fixes
Ref #2383
2019-10-08 14:50:57 -04:00
Leo Balter 917e6f7f99 Yaml consistency
Ref #2381
2019-10-08 14:48:59 -04:00
Frank Yung-Fong Tang 79a01f5122 Add tests for 'numberingSystem' and 'calendar' options (#2383)
* Add tests for 'numberingSystem' option

* add constructor-numberingSystem-order.js

* correct esid

* initial actual

* add let

* add constructor-calendar-numberingSystem-order.js
2019-10-08 14:48:46 -04:00
Frank Yung-Fong Tang b073c48b49 Add test to ensure Intl.DateTimeFormat choose pattern by calendar (#2381)
* Add test for different pattern based on calendar

* Add test for formatRangeToParts

* remove  debug print

* fix typo

* fix typo

* address review feedback

* address review feedback

* change the map and use string template

* rewrite maps and use string template
2019-10-08 14:44:41 -04:00
Frank Yung-Fong Tang 8f6369d1c4 Add more tests for ListFormat (#2387)
* add tests for ListFormat

address https://github.com/tc39/test262/issues/2386

* add test for formatToParts(undefined)

* test GetIterator throw error

* test formatToParts while GetIterator throws error

* test formatToParts while step_iterator throw

* test format while iteratorStep throw

* fix object name

* test format while IteratorValue throws

* test formatToParts while iteratorValue throws

* test formatToParts while iteratorClose call return

* check format with iteratorClose calls return
2019-10-08 14:42:42 -04:00
Frank Yung-Fong Tang 2715f312db Add tests for ListFormat StringListFromIterable ( iterable ) (#2380)
* Add tests for StringListFromIterable

* add case throw TypeError

* add test for formatToParts

* add test for formatToParts
2019-10-08 14:42:26 -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
Leo Balter e2903e2648
Merge pull request #2366 from bocoup/unnecessary-includes
Remove unnecessary "includes" directives
2019-09-27 16:46:22 -04:00
Frank Yung-Fong Tang 0213936e95 remove test for abandon ecma402/pull/345 (#2368)
https://github.com/tc39/ecma402/pull/345
2019-09-26 14:23:24 -04:00
Mike Pennisi f26c2a11bd Remove unnecessary "includes" directives
The values defined by the referenced files are not used by these tests.
This makes their inclusion superfluous, which needlessly increases the
time to execute the tests and may confuse some readers.
2019-09-25 13:59:24 -04:00
Alexey Shvayka ef7fd2bc27 Add "proto-from-ctor-realm" tests for Intl constructors (#2334)
* Rename "Object/proto-from-ctor.js" test

* Add missing "Symbol" features

* Add Intl.Collator test

* Add Intl.DateTimeFormat test

* Add Intl.NumberFormat test

* Add Intl.PluralRules test
2019-09-11 17:22:21 -03:00
André Bargull 59a1a016b7 Assign "name" property to all anonymous functions (#2299)
Implements the changes from <https://github.com/tc39/ecma262/pull/1490>.
2019-08-15 10:58:40 -04:00
Ms2ger 70a07985a5 Unified Intl.NumberFormat: Various tests (#2275)
* Unified Intl.NumberFormat: Test compact notation with various locales.

* Unified Intl.NumberFormat: Test compactDisplay constructor option.

* Unified Intl.NumberFormat: Test signDisplay constructor option.

* Unified Intl.NumberFormat: Test signDisplay with various locales.

* Unified Intl.NumberFormat: Test signDisplay with accounting currencySign in various locales.

* Unified Intl.NumberFormat: Test engineering and scientific notations in various locales.

* Unified Intl.NumberFormat: Test unit handling.

* Unified Intl.NumberFormat: Test notation constructor option.

* Unified Intl.NumberFormat: Test engineering and scientific notations with negative exponents.

* Unified Intl.NumberFormat: Test near-zero arguments with signDisplay.

* Unified Intl.NumberFormat: Test units.

* Unified Intl.NumberFormat: Test unit arguments.

* Unified Intl.NumberFormat: Add a generic test for unit arguments.

* Unified Intl.NumberFormat: Test the unitDisplay argument.
2019-08-14 12:47:05 -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
Leo Balter 1cb241cf36
Merge pull request #2097 from anba/canonical-jan2019
Fix various test issues (Was: Unicode BCP 47 Locale Identifier changes)
2019-07-22 08:57:24 -04:00
Frank Yung-Fong Tang 76eca53cb8 add fractionalSecondDigits.js for formatRange (#2242) 2019-07-22 08:54:24 -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 8b725e3957 Updates test for Intl.NumberFormat Unified API Proposal changes. 2019-07-22 02:12:27 -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 7b556c6ff2 Intl.getCanonicalLocales changes for UTS 35
intl402/Intl/getCanonicalLocales/canonicalized-tags.js
- Sign languages are no longer canonicalised.
- Variant subtags are sorted alphabetically.

intl402/Intl/getCanonicalLocales/preferred-grandfathered.js
- Canonical form of "cel-gaulish" is "xtg-x-cel-gaulish".

intl402/Intl/getCanonicalLocales/preferred-variant.js
- Variant subtags are no longer canonicalised.
2019-07-22 02:12:18 -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
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
André Bargull 94053978bc Update language tag canonicalisation per UTS35
Main changes:
- "cmn" is now canonicalised to "zh"
- "und-x-" is prepended before grandfathered tags without modern replacements
- "und-" is prepended before privateuse-only language tags
2019-07-21 05:44:21 -07:00
Frank Yung-Fong Tang dce0910981 change to camelCase to sync with #54 (#2240)
to sync with https://github.com/tc39/proposal-unified-intl-numberformat/pull/54
@sffc @leobalter
2019-07-16 19:00:29 -04:00
Leo Balter cd79eada15 Update test files to follow lint rule 2019-07-15 14:03:25 -04:00
Frank Yung-Fong Tang f7e6656c13 Remove tests for "quarter" option of Intl.DateTimeFormat (#2232) 2019-07-15 13:51:22 -04:00