diff options
Diffstat (limited to 'test/built-ins/parseFloat')
30 files changed, 658 insertions, 0 deletions
diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bd-nsl-bd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bd-nsl-bd.js new file mode 100644 index 000000000..2f994aa3e --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bd-nsl-bd.js @@ -0,0 +1,23 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0b StrBinaryDigits, 0B StrBinaryDigits +info: | + + StrBinaryIntegerLiteral ::: + 0b StrBinaryDigits + 0B StrBinaryDigits + + StrBinaryDigits ::: + BinaryDigit + StrBinaryDigits BinaryDigit + + BinaryDigit ::: one of + 0 1 + +---*/ + +assert.sameValue(parseFloat("0b0_1"), 0b0); +assert.sameValue(parseFloat("0B0_1"), 0B0); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bd-nsl-bds.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bd-nsl-bds.js new file mode 100644 index 000000000..d5164500b --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bd-nsl-bds.js @@ -0,0 +1,23 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0b StrBinaryDigits, 0B StrBinaryDigits +info: | + + StrBinaryIntegerLiteral ::: + 0b StrBinaryDigits + 0B StrBinaryDigits + + StrBinaryDigits ::: + BinaryDigit + StrBinaryDigits BinaryDigit + + BinaryDigit ::: one of + 0 1 + +---*/ + +assert.sameValue(parseFloat("0b0_10"), 0b0); +assert.sameValue(parseFloat("0B0_10"), 0B0); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bds-nsl-bd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bds-nsl-bd.js new file mode 100644 index 000000000..dc4207be9 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bds-nsl-bd.js @@ -0,0 +1,23 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0b StrBinaryDigits, 0B StrBinaryDigits +info: | + + StrBinaryIntegerLiteral ::: + 0b StrBinaryDigits + 0B StrBinaryDigits + + StrBinaryDigits ::: + BinaryDigit + StrBinaryDigits BinaryDigit + + BinaryDigit ::: one of + 0 1 + +---*/ + +assert.sameValue(parseFloat("0b01_0"), 0b01); +assert.sameValue(parseFloat("0B01_0"), 0B01); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bds-nsl-bds.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bds-nsl-bds.js new file mode 100644 index 000000000..daa545afb --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bds-nsl-bds.js @@ -0,0 +1,23 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0b StrBinaryDigits, 0B StrBinaryDigits +info: | + + StrBinaryIntegerLiteral ::: + 0b StrBinaryDigits + 0B StrBinaryDigits + + StrBinaryDigits ::: + BinaryDigit + StrBinaryDigits BinaryDigit + + BinaryDigit ::: one of + 0 1 + +---*/ + +assert.sameValue(parseFloat("0b01_00"), 0b01); +assert.sameValue(parseFloat("0B01_00"), 0B01); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js new file mode 100644 index 000000000..8463acc6e --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js @@ -0,0 +1,19 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: StrDecimalDigits . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + StrDecimalDigits . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits NumericLiteralSeparator DecimalDigit + + +---*/ + +assert.sameValue(parseFloat("1.0e-1_0"), 1.0e-1); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js new file mode 100644 index 000000000..31afc26b4 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js @@ -0,0 +1,19 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: StrDecimalDigits . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + StrDecimalDigits . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits NumericLiteralSeparator DecimalDigit + + +---*/ + +assert.sameValue(parseFloat("1.0e-10_0"), 1.0e-10); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js new file mode 100644 index 000000000..4331a370d --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: > + StrDecimalDigits . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + StrDecimalDigits . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits NumericLiteralSeparator DecimalDigit + + +---*/ + +assert.sameValue(parseFloat("1.0e+1_0"), 1.0e+1); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js new file mode 100644 index 000000000..f68cc93c8 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: StrDecimalDigits . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + StrDecimalDigits . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits NumericLiteralSeparator DecimalDigit + + +---*/ + +assert.sameValue(parseFloat("1.0e+10_0"), 1.0e+10); + diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-nsl-dd-one-of.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-nsl-dd-one-of.js new file mode 100644 index 000000000..fb0ba7236 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-nsl-dd-one-of.js @@ -0,0 +1,31 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: StrUnsignedDecimalLiteral +info: | + + StrStrUnsignedDecimalLiteral ::: + StrUnsignedDecimalLiteral + + + StrDecimalDigits ::: + DecimalDigit + ... + + DecimalDigit ::: one of + 0 1 2 3 4 5 6 7 8 9 + +---*/ + +assert.sameValue(parseFloat("1_0"), 1); +assert.sameValue(parseFloat("1_1"), 1); +assert.sameValue(parseFloat("1_2"), 1); +assert.sameValue(parseFloat("1_3"), 1); +assert.sameValue(parseFloat("1_4"), 1); +assert.sameValue(parseFloat("1_5"), 1); +assert.sameValue(parseFloat("1_6"), 1); +assert.sameValue(parseFloat("1_7"), 1); +assert.sameValue(parseFloat("1_8"), 1); +assert.sameValue(parseFloat("1_9"), 1); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js new file mode 100644 index 000000000..b90c3b22c --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: StrDecimalDigits . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits DecimalDigit + +---*/ + +assert.sameValue(parseFloat("10.00_01e2"), 10.00); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dds-nsl-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dds-nsl-dd.js new file mode 100644 index 000000000..b4d6094eb --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dds-nsl-dd.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: StrDecimalDigits +info: | + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits DecimalDigit + +---*/ + +assert.sameValue(parseFloat("123456789_0"), 123456789); +assert.sameValue(parseFloat("123456789_1"), 123456789); +assert.sameValue(parseFloat("123456789_2"), 123456789); +assert.sameValue(parseFloat("123456789_3"), 123456789); +assert.sameValue(parseFloat("123456789_4"), 123456789); +assert.sameValue(parseFloat("123456789_5"), 123456789); +assert.sameValue(parseFloat("123456789_6"), 123456789); +assert.sameValue(parseFloat("123456789_7"), 123456789); +assert.sameValue(parseFloat("123456789_8"), 123456789); +assert.sameValue(parseFloat("123456789_9"), 123456789); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dd-ep.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dd-ep.js new file mode 100644 index 000000000..721a67901 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dd-ep.js @@ -0,0 +1,19 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + ... + StrDecimalDigits DecimalDigit + +---*/ + +assert.sameValue(parseFloat(".0_1e2"), .0); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dds-ep.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dds-ep.js new file mode 100644 index 000000000..1f3dc3b30 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dds-ep.js @@ -0,0 +1,19 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + ... + StrDecimalDigits DecimalDigit + +---*/ + +assert.sameValue(parseFloat(".1_01e2"), .1); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dds-nsl-dd-ep.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dds-nsl-dd-ep.js new file mode 100644 index 000000000..278dbe682 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dds-nsl-dd-ep.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits DecimalDigit + +---*/ + +assert.sameValue(parseFloat(".10_1e2"), .10); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dds-nsl-dds-ep.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dds-nsl-dds-ep.js new file mode 100644 index 000000000..da0490ddd --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dds-nsl-dds-ep.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: . StrDecimalDigits StrExponentPart +info: | + + StrUnsignedDecimalLiteral ::: + . StrDecimalDigits StrExponentPart + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits DecimalDigit + +---*/ + +assert.sameValue(parseFloat(".00_01e2"), .00); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hd-nsl-hd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hd-nsl-hd.js new file mode 100644 index 000000000..59330a2f4 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hd-nsl-hd.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0x StrHexDigits, 0X StrHexDigits +info: | + + StrHexLiteral ::: + 0x StrHexDigits + 0X StrHexDigits + + StrHexDigits ::: + HexDigit + StrHexDigits HexDigit + +---*/ + +assert.sameValue(parseFloat("0x0_1"), 0x0); +assert.sameValue(parseFloat("0X0_1"), 0X0); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hd-nsl-hds.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hd-nsl-hds.js new file mode 100644 index 000000000..06f3a44c6 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hd-nsl-hds.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0x StrHexDigits, 0X StrHexDigits +info: | + + StrHexLiteral ::: + 0x StrHexDigits + 0X StrHexDigits + + StrHexDigits ::: + HexDigit + StrHexDigits HexDigit + +---*/ + +assert.sameValue(parseFloat("0x0_10"), 0x0); +assert.sameValue(parseFloat("0X0_10"), 0X0); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hd.js new file mode 100644 index 000000000..e4bc5b9fd --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hd.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0x StrHexDigits, 0X StrHexDigits +info: | + + StrHexLiteral ::: + 0x StrHexDigits + 0X StrHexDigits + + StrHexDigits ::: + HexDigit + StrHexDigits HexDigit + +---*/ + +assert.sameValue(parseFloat("0x01_0"), 0x01); +assert.sameValue(parseFloat("0X01_0"), 0X01); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hds.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hds.js new file mode 100644 index 000000000..4cbdf527a --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hds.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0x StrHexDigits, 0X StrHexDigits +info: | + + StrHexLiteral ::: + 0x StrHexDigits + 0X StrHexDigits + + StrHexDigits ::: + HexDigit + StrHexDigits HexDigit + +---*/ + +assert.sameValue(parseFloat("0x01_00"), 0x01); +assert.sameValue(parseFloat("0X01_00"), 0X01); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-od-nsl-od-one-of.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-od-nsl-od-one-of.js new file mode 100644 index 000000000..c28f00087 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-od-nsl-od-one-of.js @@ -0,0 +1,40 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0x StrHexDigits, 0X StrHexDigits +info: | + + StrHexLiteral ::: + 0x StrHexDigits + 0X StrHexDigits + + StrHexDigits ::: + HexDigit + StrHexDigits HexDigit + +---*/ + +assert.sameValue(parseFloat("0x0_0"), 0x0); +assert.sameValue(parseFloat("0x1_1"), 0x1); +assert.sameValue(parseFloat("0x2_2"), 0x2); +assert.sameValue(parseFloat("0x3_3"), 0x3); +assert.sameValue(parseFloat("0x4_4"), 0x4); +assert.sameValue(parseFloat("0x5_5"), 0x5); +assert.sameValue(parseFloat("0x6_6"), 0x6); +assert.sameValue(parseFloat("0x7_7"), 0x7); +assert.sameValue(parseFloat("0x8_8"), 0x8); +assert.sameValue(parseFloat("0x9_9"), 0x9); +assert.sameValue(parseFloat("0xa_a"), 0xa); +assert.sameValue(parseFloat("0xb_b"), 0xb); +assert.sameValue(parseFloat("0xc_c"), 0xc); +assert.sameValue(parseFloat("0xd_d"), 0xd); +assert.sameValue(parseFloat("0xe_e"), 0xe); +assert.sameValue(parseFloat("0xf_f"), 0xf); +assert.sameValue(parseFloat("0xA_A"), 0xA); +assert.sameValue(parseFloat("0xB_B"), 0xB); +assert.sameValue(parseFloat("0xC_C"), 0xC); +assert.sameValue(parseFloat("0xD_D"), 0xD); +assert.sameValue(parseFloat("0xE_E"), 0xE); +assert.sameValue(parseFloat("0xF_F"), 0xF); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dd-one-of.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dd-one-of.js new file mode 100644 index 000000000..932a83451 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dd-one-of.js @@ -0,0 +1,33 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: NonZeroDigit NumericLiteralSeparator DecimalDigit +info: | + + StrStrUnsignedDecimalLiteral ::: + StrUnsignedDecimalLiteral + + NonZeroDigit ::: one of + 1 2 3 4 5 6 7 8 9 + + StrDecimalDigits ::: + DecimalDigit + ... + + DecimalDigit ::: one of + 0 1 2 3 4 5 6 7 8 9 + +---*/ + +assert.sameValue(parseFloat("1_0"), 1); +assert.sameValue(parseFloat("1_1"), 1); +assert.sameValue(parseFloat("2_2"), 2); +assert.sameValue(parseFloat("3_3"), 3); +assert.sameValue(parseFloat("4_4"), 4); +assert.sameValue(parseFloat("5_5"), 5); +assert.sameValue(parseFloat("6_6"), 6); +assert.sameValue(parseFloat("7_7"), 7); +assert.sameValue(parseFloat("8_8"), 8); +assert.sameValue(parseFloat("9_9"), 9); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dd.js new file mode 100644 index 000000000..4f454d595 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dd.js @@ -0,0 +1,16 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: StrDecimalDigits +info: | + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits DecimalDigit + ... + +---*/ + +assert.sameValue(parseFloat("1_1"), 1); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dds.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dds.js new file mode 100644 index 000000000..e182b0a3c --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dds.js @@ -0,0 +1,15 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: DecimalDigit +info: | + + StrDecimalDigits ::: + DecimalDigit + StrDecimalDigits DecimalDigit + +---*/ + +assert.sameValue(parseFloat("1_0123456789"), 1); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-od-one-of.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-od-one-of.js new file mode 100644 index 000000000..fd9e178d9 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-od-one-of.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0o StrOctalDigits, 0O StrOctalDigits +info: | + + StrOctalLiteral ::: + 0o StrOctalDigits + 0O StrOctalDigits + + StrOctalDigits ::: + OctalDigit + StrOctalDigits OctalDigit + +---*/ + +assert.sameValue(parseFloat("0o0_0"), 0o0); +assert.sameValue(parseFloat("0o1_1"), 0o1); +assert.sameValue(parseFloat("0o2_2"), 0o2); +assert.sameValue(parseFloat("0o3_3"), 0o3); +assert.sameValue(parseFloat("0o4_4"), 0o4); +assert.sameValue(parseFloat("0o5_5"), 0o5); +assert.sameValue(parseFloat("0o6_6"), 0o6); +assert.sameValue(parseFloat("0o7_7"), 0o7); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-od.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-od.js new file mode 100644 index 000000000..0721ea985 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-od.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0o StrOctalDigits, 0O StrOctalDigits +info: | + + StrOctalLiteral ::: + 0o StrOctalDigits + 0O StrOctalDigits + + StrOctalDigits ::: + OctalDigit + StrOctalDigits OctalDigit + +---*/ + +assert.sameValue(parseFloat("0o0_1"), 0o0); +assert.sameValue(parseFloat("0O0_1"), 0O0); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-ods.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-ods.js new file mode 100644 index 000000000..174e45325 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-ods.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0o StrOctalDigits, 0O StrOctalDigits +info: | + + StrOctalLiteral ::: + 0o StrOctalDigits + 0O StrOctalDigits + + StrOctalDigits ::: + OctalDigit + StrOctalDigits OctalDigit + +---*/ + +assert.sameValue(parseFloat("0o0_10"), 0o0); +assert.sameValue(parseFloat("0O0_10"), 0O0); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-od.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-od.js new file mode 100644 index 000000000..6f328e3dd --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-od.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0o StrOctalDigits, 0O StrOctalDigits +info: | + + StrOctalLiteral ::: + 0o StrOctalDigits + 0O StrOctalDigits + + StrOctalDigits ::: + OctalDigit + StrOctalDigits OctalDigit + +---*/ + +assert.sameValue(parseFloat("0o01_0"), 0o01); +assert.sameValue(parseFloat("0O01_0"), 0O01); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-ods.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-ods.js new file mode 100644 index 000000000..4ccd61f37 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-ods.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: 0o StrOctalDigits, 0O StrOctalDigits +info: | + + StrOctalLiteral ::: + 0o StrOctalDigits + 0O StrOctalDigits + + StrOctalDigits ::: + OctalDigit + StrOctalDigits OctalDigit + +---*/ + +assert.sameValue(parseFloat("0o01_00"), 0o01); +assert.sameValue(parseFloat("0O01_00"), 0O01); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-sign-minus-dds-nsl-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-sign-minus-dds-nsl-dd.js new file mode 100644 index 000000000..a0917f913 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-sign-minus-dds-nsl-dd.js @@ -0,0 +1,26 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: > + StrUnsignedDecimalLiteral, + StrUnsignedDecimalLiteral, - StrUnsignedDecimalLiteral +info: | + + StrDecimalLiteral ::: + StrUnsignedDecimalLiteral + + StrUnsignedDecimalLiteral + - StrUnsignedDecimalLiteral + +---*/ + +assert.sameValue(parseFloat("-123456789_0"), -123456789); +assert.sameValue(parseFloat("-123456789_1"), -123456789); +assert.sameValue(parseFloat("-123456789_2"), -123456789); +assert.sameValue(parseFloat("-123456789_3"), -123456789); +assert.sameValue(parseFloat("-123456789_4"), -123456789); +assert.sameValue(parseFloat("-123456789_5"), -123456789); +assert.sameValue(parseFloat("-123456789_6"), -123456789); +assert.sameValue(parseFloat("-123456789_7"), -123456789); +assert.sameValue(parseFloat("-123456789_8"), -123456789); +assert.sameValue(parseFloat("-123456789_9"), -123456789); diff --git a/test/built-ins/parseFloat/tonumber-numeric-separator-literal-sign-plus-dds-nsl-dd.js b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-sign-plus-dds-nsl-dd.js new file mode 100644 index 000000000..224a0e4e3 --- /dev/null +++ b/test/built-ins/parseFloat/tonumber-numeric-separator-literal-sign-plus-dds-nsl-dd.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: StrUnsignedDecimalLiteral +info: | + + StrDecimalLiteral ::: + StrUnsignedDecimalLiteral + + StrUnsignedDecimalLiteral + - StrUnsignedDecimalLiteral + +---*/ + +assert.sameValue(parseFloat("+123456789_0"), +123456789); +assert.sameValue(parseFloat("+123456789_1"), +123456789); +assert.sameValue(parseFloat("+123456789_2"), +123456789); +assert.sameValue(parseFloat("+123456789_3"), +123456789); +assert.sameValue(parseFloat("+123456789_4"), +123456789); +assert.sameValue(parseFloat("+123456789_5"), +123456789); +assert.sameValue(parseFloat("+123456789_6"), +123456789); +assert.sameValue(parseFloat("+123456789_7"), +123456789); +assert.sameValue(parseFloat("+123456789_8"), +123456789); +assert.sameValue(parseFloat("+123456789_9"), +123456789); |