Commit Graph

190 Commits

Author SHA1 Message Date
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 8b725e3957 Updates test for Intl.NumberFormat Unified API Proposal changes. 2019-07-22 02:12:27 -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
Frank Yung-Fong Tang f7a3f63270 remove (min|max)imumFractionDigits w/ significant (#2189)
Per change in https://tc39.github.io/proposal-unified-intl-numberformat/section11/numberformat_diff_out.html
we should not output minimumFractionDigits and maximumFractionDigits if minimumSignificantDigits or maximumSignificantDigits are set.
2019-06-05 04:08:54 -04:00
Daniel Ehrenberg 80af423aca intl tests for proposed additional options in options bag (#1225)
This patch implements tests for the ECMA 402 PR at
https://github.com/tc39/ecma402/pull/175

It is based on the test test/intl402/Collator/10.1.1_19_c.js
2019-05-16 13:46:08 -04:00
Frank Yung-Fong Tang 9b0d09eb11
change the removed unit 'generic' to 'gigabit' 2019-05-15 22:14:13 -07:00
Frank Yung-Fong Tang 6da911b9f2 Fix the rounding issue (#2027) 2019-01-28 11:52:50 -05:00
Frank Yung-Fong Tang e0a07bc650 Correct the expectation for format-fraction-digits-precision (#2025) 2019-01-28 11:42:22 -05:00
André Bargull b62dae4fff Fix various bugs in test cases (#1988) 2018-12-05 15:48:28 -05:00
Ms2ger d857bd6f72 Unified Intl.NumberFormat: Add some initial tests for SetNumberFormatUnitOptions. 2018-11-28 10:25:18 -05:00
Ms2ger fa16d7df3f Intl: Add tests for table iteration order.
The order was defined in <https://github.com/tc39/ecma402/pull/279>.
2018-10-17 12:59:38 -04:00
André Bargull d3e5b818d9 Revert "remove "invalid" from invalid date of "cu" and "nu""
This reverts commit a1c3929c35.
2018-10-17 07:46:46 -07:00
André Bargull faed4fb089 Fix various test issues 2018-10-17 07:45:33 -07:00
Ujjwal Sharma 9dc33cc5b4 intl: fix mistyped test for array-like objects 2018-10-15 12:54:05 -04:00
Ujjwal Sharma f8e3a8ed11 Add let before variable declaration 2018-10-05 15:32:54 -04:00
Ujjwal Sharma ec35b59e88 intl: increase coverage for the NumberFormat constructor
Increase the coverage for the constructor for Intl.NumberFormat by
ensuring that HasProperty(O, Pk) is properly called.
2018-10-05 15:32:54 -04:00
Ujjwal Sharma f8e0bf6751 intl: fix dicey test case 2018-10-04 14:30:22 -04:00
Ujjwal Sharma ff8b10c448 intl: increase coverage for the Intl.NumberFormat constructor
Increase coverge for the Intl.NumberFormat constructor by testing that
Get(O, P) and ToString(arg) are properly called.
2018-10-03 17:32:33 -04:00
Frank Tang a1c3929c35 remove "invalid" from invalid date of "cu" and "nu" 2018-10-03 13:22:29 -04:00
Ujjwal Sharma 041d5acd5e Update test to actually check properties 2018-10-03 13:13:58 -04:00
Ujjwal Sharma de416c28c3 intl: increase coverage from the NumberFormat constructor
Improve coverage for the Intl.NumberFormat constructor by testing that
it accepts Array-like objects and handles them properly.
2018-10-03 13:13:58 -04:00
Ujjwal Sharma cd55e30938 Update test to actually check properties 2018-10-03 11:07:06 -04:00
Ujjwal Sharma af0f53bb40 intl: increase coverage for the NumberFormat constructor
Increase coverage for the Intl.NumberFormat constructor by testing that
passing a string value to the Intl.NumberFormat constructor is
equivalent to passing an Array containing the same string value.
2018-10-03 11:07:06 -04:00
Rick Waldron 0ead0130ea Intl.NumberFormat: cannot use assert.sameValue to compare object references. 2018-10-02 15:03:52 -04:00
Ujjwal Sharma bba2429cad intl: increase coverage for NumberFormat constructor
Increase coverage for the Intl.NumberFormat constructor by adding tests
checking if appropriate default values are used.
2018-10-02 14:51:22 -04:00
Ujjwal Sharma e9946587b9 Update test to include object and symbol 2018-10-02 14:49:00 -04:00
Ujjwal Sharma bb7585bdaf intl: increase coverage for NumberFormat constructor
Increase coverage for the Intl.NumberFormat class contructor by adding
tests for checking that it calls ToObject on the options argument.
2018-10-02 14:49:00 -04:00
Ujjwal Sharma 24386286f1 Update filenames and fix failures 2018-10-02 14:48:37 -04:00
Ujjwal Sharma 2ecd230b63 Update test to include object and symbol 2018-10-02 14:48:37 -04:00
Ujjwal Sharma 5fe9773f44 intl: increase coverage for NumberFormat constructor
Increase coverage for the Intl.NumberFormat class contructor by adding
tests for checking that it calls ToObject on the locales argument.
2018-10-02 14:48:37 -04:00
Ujjwal Sharma 5fae9deb1f intl: rework Intl.NumberFormat.prototype.formatToParts tests
Rework the available tests for Intl.NumberFormat.prototype.formatToParts
to improve consistency and readability.
2018-09-27 11:03:16 -04:00
Ujjwal Sharma 41bf0ee344 intl: add assertion to test that the result for default parameter
Add an assertion to the test for default parameters in Intl.NumberFormat's
method formatToParts checking that both the values are equal to the correct
result.
2018-09-27 11:00:55 -04:00
André Bargull 3a1bcae4d1 Expect leading sign when the input is negative zero 2018-09-26 10:38:35 -04:00
André Bargull d9f67d53d1 Move the extra precision tests into separate files
This will allow implementations to test the rest of the number formatting tests,
even if the extra precision support isn't implemented.
2018-09-26 10:38:35 -04:00
André Bargull 4bc96880a1 Add missing explicit ToString conversion for symbol values and ensure the expected NaN result is a (locale-dependent) string 2018-09-26 10:38:35 -04:00
Ujjwal Sharma cdd91e2895 Improve ToNumber test for NumberFormat.format 2018-09-20 17:25:14 -04:00
Ujjwal Sharma 7a87bde265 intl: increase coverage for NumberFormat.format
Increase test coverage for Intl.NumberFormat.prototype.format by adding
a check for testing if it calls ToNumber (7.1.3) on its argument.
2018-09-20 17:25:14 -04:00
Ujjwal Sharma a6412918d2 Simplify default value check of NumberFormat.format 2018-09-19 15:23:30 -04:00
Ujjwal Sharma cbfa2c5f00 intl: increase coverage for NumberFormat
Increase coverage for Intl.NumberFormat by adding a test for format
checking it's default value.
2018-09-19 15:23:30 -04:00
Ujjwal Sharma 94cb047ab8 Update assert failure messages 2018-09-18 14:55:11 -04:00
Ujjwal Sharma 0c89259da5 intl: refactor tests for NumberFormat 2018-09-18 14:55:11 -04:00
Ujjwal Sharma fec7982e09 Update test case description 2018-09-18 11:42:59 -04:00
Ujjwal Sharma 490f911ab6 Refactor value check for prop-desc 2018-09-18 11:42:59 -04:00
Ujjwal Sharma 24c29db550 Rename initial-value to configurable and add initial check to prop-desc 2018-09-18 11:42:59 -04:00
Ujjwal Sharma e566c813b5 Add additional initial value tests 2018-09-18 11:42:59 -04:00
Ujjwal Sharma c129ac8546 intl: improve coverage for Intl.NumberFormat
Add tests for Intl.NumberFormat.prototype[@@toStringTag].
2018-09-18 11:42:59 -04:00
Ms2ger 9271068a83 Intl: Add tests for throwing getters in options objects. 2018-09-18 11:39:47 -04:00
Ujjwal Sharma 12055caa1c Add symbol to list of invalid targets 2018-09-17 15:59:58 -04:00
Ujjwal Sharma db238a1abe intl: improve coverage for Intl.NumberFormat
Add Intl.NumberFormat.prototype.formatToParts to the test
this-value-not-numberformat.js to check if a TypeError is thrown if the
"this" value for the function call isn't a valid NumberFormat object.
2018-09-17 15:59:58 -04:00
Ms2ger 8e15f532e1 Intl.NumberFormat: Update another test for negative zero.
The specification was updated in https://github.com/tc39/ecma402/pull/232.
2018-07-27 13:00:04 -04:00
Ms2ger 65f2d5e8c2 Update the test for negative zero in NumberFormat.
The specification was updated in https://github.com/tc39/ecma402/pull/232.
2018-07-06 17:29:17 +02:00
Rick Waldron acf6de15ec intl402/NumberFormat/length.js: remove calls to verifyNotEnumerable, verifyNotWritable, verifyConfigurable. Fixes gh-1591 2018-06-07 22:14:33 -04:00
Rick Waldron fbccd8eeff Intl: PluralRules, NumberFormat, Number & getCanonicalLocales to use verifyProperty
There's a lot of work like this to do, but not enough time in the day to reach it all.
2018-05-18 12:35:06 -04:00
Rick Waldron d7b5715e6c Fix: various lint fixes 2018-01-11 10:21:08 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
Rick Waldron 5155397373 Add missing features 2017-12-21 16:46:57 -05:00
André Bargull 91460f90de Update property-descriptor tests to use verifyProperty 2017-12-21 16:46:56 -05:00
André Bargull c9ef958d01 Update currency digits data 2017-12-21 16:46:56 -05:00
André Bargull b6e9f9425f Remove unused includes in Intl test files 2017-12-21 16:46:56 -05:00
André Bargull a380c6b000 Use more descriptive names for Intl test files 2017-12-21 16:46:56 -05:00
André Bargull 60692bb6e0 Move remaining testBuiltInObject callers to use normal assert calls 2017-12-21 16:46:56 -05:00
André Bargull c81370348d No longer use testBuiltInObject for built-in objects 2017-12-21 16:46:56 -05:00
André Bargull ecf814bb4c No longer use testBuiltInObject for built-in constructors 2017-12-21 16:46:56 -05:00
André Bargull 4337b396bd Add separate test files for property attributes of Intl properties 2017-12-21 16:46:56 -05:00
André Bargull 513a3056fb Add separate test files to test the length property of Intl functions 2017-12-21 16:46:56 -05: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 56323fe2dd Also test Intl.PluralRules if available 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
Zibi Braniecki 2889100f21 Update Intl.NumberFormat.prototype.formatToParts.length to expect 1 (#1249)
As per https://github.com/tc39/ecma402/pull/160 the formatToParts.length is set to 1.
2017-10-02 15:41:27 -04:00
Josh Wolfe 261579694e NumberFormat formatToParts with no arguments 2017-09-19 11:52:36 -04:00
Daniel Ehrenberg 765f273ac4 intl: Tests for default options tweak proposal (#1220)
Tests for ECMA 402 PR https://github.com/tc39/ecma402/pull/170
The tests on Date/DateTimeFormat are valid without the PR.
2017-09-12 12:12:55 -04:00
Daniel Ehrenberg 8e5ffb66bf Add tests for proposal to make Intl prototypes not instances (#1079)
This proposal was started in https://github.com/tc39/ecma402/issues/122,
and specified in https://github.com/tc39/ecma402/pull/148
2017-09-06 13:58:03 -04:00
André Bargull 8bed4d442d Use assert-lib: intl402/NumberFormat 2017-05-04 21:14:46 +02:00
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
André Bargull 3291704eb2
Fix multiple test errors
Tests doesn't use async functionality and don't call $DONE, so remove
"async" flag:
- src/params/error/async-gen-named-func-expr.template
- test/language/expressions/async-generator/params-named-dflt-abrupt.js
- test/language/expressions/async-generator/params-named-dflt-ref-later.js
- test/language/expressions/async-generator/params-named-dflt-ref-self.js

Intl.PluralRules.prototype is no longer a Intl.Prototype instance:
- test/intl402/PluralRules/prototype/prototype.js

Intl.PluralRules throws an error when called as a function:
- test/intl402/PluralRules/undefined-newtarget-throws.js

Module namespace objects call OrdinaryDelete for symbol properties:
- test/language/module-code/namespace/internals/delete-non-exported.js

Async generators no longer retrieves "done" property twice:
- src/async-generators/yield-star-async-next.case
- src/async-generators/yield-star-async-return.case
- src/async-generators/yield-star-async-throw.case

Minor units of CLF is 4, so we need to test with maximumFractionDigits=3
to get an error:
- test/intl402/NumberFormat/dft-currency-mnfd-range-check-mxfd.js

DateTimeFormat.prototype.formatToParts length property was changed from
0 to 1:
- test/intl402/DateTimeFormat/prototype/formatToParts/length.js

minimumSignificantDigits and maximumSignificantDigits properties are
only retrieved once:
- test/intl402/NumberFormat/11.1.1_32.js
2017-04-06 15:30:13 -04:00
Daniel Ehrenberg a9d9ab1a51
Add tests for some NumberFormat options edge cases
Closes #888

These tests are regression tests for V8 failures at top of tree,
https://bugs.chromium.org/p/v8/issues/detail?id=6015
https://bugs.chromium.org/p/v8/issues/detail?id=6016

Neither issue is present in JSC or SpiderMonkey. They are fixed
by the V8 patch
https://codereview.chromium.org/2717613005
2017-03-23 11:50:33 -07:00
Leo Balter 6c20a250f2 Add references to fixed tests for NumberFormat operations (#874)
Ref #856
Ref #857
Ref tc39/ecma402#128
2017-03-13 10:47:30 -07:00
vabr-g 42ebb3a9ab Add test for NumberFormat default minimumSignificantDigits (#864) 2017-03-01 16:39:57 -05:00
Viktor 58b326f0c4 fix for the wrong test of Intl.NumberFormat (ToRawPrecision) (#857)
1) (123.44500) == 123.444999999999993179
2) (123.44500).toPrecision(5) === "123.44" gives correct value in Chrome and Firefox;

Ref https://github.com/tc39/ecma402/issues/128
2017-03-01 16:14:33 -05:00
Viktor 9fd3b582c7 fix for the wrong test of Intl.NumberFormat (ToRawFixed) (#856)
Note:
12344501000000000487815444678311936 === 12344501000000000000000000000000000 for binary64 floating points;

Ref https://github.com/tc39/ecma402/issues/128
2017-03-01 16:14:00 -05:00
André Bargull 76320ad18d Update tests when Intl constructor is called as a function
https://github.com/tc39/ecma402/issues/57
https://github.com/tc39/ecma402/pull/84
2017-02-22 18:05:34 +01:00
Zibi Braniecki 28fc809f3e Remove BYR currency code which has been removed from ISO 4217 (#818) 2017-01-09 14:27:23 -08:00
jungshik 6a0f1189eb Drop 3 tests testing an obsolete Ecma402 v1 spec (#807)
The following three tests check an obsolete provision in Ecma 402
v1 regarding Intl.{Collator,DateTimeFormat,NumberFormat} constructor
called as a function.

Collator/10.1.2.1_4.js
DateTimeFormat/12.1.2.1_4.js
NumberFormat/11.1.2.1_4.js
2016-12-21 11:11:39 -08:00
Zibi Braniecki cac55f2999 NumberFormat.prototype.formatToParts tests, part 1 (#744) 2016-08-15 15:23:34 -07:00
Leonardo Balter bf782c8421 s/id/esid
Fixes #477
2016-02-22 09:47:42 -05:00
André Bargull 31a9036e9b Add coverage for 'name' property of Intl built-in functions 2016-02-12 18:58:57 +01:00
André Bargull 932bd1a12c Move intl tests to sub-folders 2015-07-31 17:12:08 +02:00