summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/literals/bigint/numeric-separators/numeric-separator-literal-sign-minus-dds-nsl-dd.js
blob: f3eabae0877f4c9781a360960d8e058a8aef54cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: prod-NumericLiteralSeparator
description: DecimalDigits NumericLiteralSeparator DecimalDigit
info: |
  NumericLiteral ::
    DecimalIntegerLiteral BigIntLiteralSuffix
    NumericLiteralBase BigIntLiteralSuffix

  NumericLiteralBase ::
    BinaryIntegerLiteral
    OctalIntegerLiteral
    HexIntegerLiteral

  BigIntLiteralSuffix :: n

  NumericLiteralSeparator ::
    _

  SignedInteger ::
    ...
    - DecimalDigits

features: [BigInt, numeric-separator-literal]
---*/

assert.sameValue(-123456789_0n, -1234567890n);
assert.sameValue(-123456789_1n, -1234567891n);
assert.sameValue(-123456789_2n, -1234567892n);
assert.sameValue(-123456789_3n, -1234567893n);
assert.sameValue(-123456789_4n, -1234567894n);
assert.sameValue(-123456789_5n, -1234567895n);
assert.sameValue(-123456789_6n, -1234567896n);
assert.sameValue(-123456789_7n, -1234567897n);
assert.sameValue(-123456789_8n, -1234567898n);
assert.sameValue(-123456789_9n, -1234567899n);

reportCompare(0, 0);