| 1 |
// Copyright (C) 2018 Igalia, S.L. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
description: Relational comparison of BigInt and string values |
| 5 |
esid: sec-abstract-relational-comparison |
| 6 |
features: [BigInt] |
| 7 |
---*/ |
| 8 |
assert.sameValue(0n >= '0', true, 'The result of (0n >= "0") is true'); |
| 9 |
assert.sameValue('0' >= 0n, true, 'The result of ("0" >= 0n) is true'); |
| 10 |
assert.sameValue(0n >= '1', false, 'The result of (0n >= "1") is false'); |
| 11 |
assert.sameValue('0' >= 1n, false, 'The result of ("0" >= 1n) is false'); |
| 12 |
assert.sameValue(1n >= '0', true, 'The result of (1n >= "0") is true'); |
| 13 |
assert.sameValue('1' >= 0n, true, 'The result of ("1" >= 0n) is true'); |
| 14 |
assert.sameValue(0n >= '', true, 'The result of (0n >= "") is true'); |
| 15 |
assert.sameValue('' >= 0n, true, 'The result of ("" >= 0n) is true'); |
| 16 |
assert.sameValue(0n >= '1', false, 'The result of (0n >= "1") is false'); |
| 17 |
assert.sameValue('' >= 1n, false, 'The result of ("" >= 1n) is false'); |
| 18 |
assert.sameValue(1n >= '', true, 'The result of (1n >= "") is true'); |
| 19 |
assert.sameValue('1' >= 0n, true, 'The result of ("1" >= 0n) is true'); |
| 20 |
assert.sameValue(1n >= '1', true, 'The result of (1n >= "1") is true'); |
| 21 |
assert.sameValue('1' >= 1n, true, 'The result of ("1" >= 1n) is true'); |
| 22 |
assert.sameValue(1n >= '-1', true, 'The result of (1n >= "-1") is true'); |
| 23 |
assert.sameValue('1' >= -1n, true, 'The result of ("1" >= -1n) is true'); |
| 24 |
assert.sameValue(-1n >= '1', false, 'The result of (-1n >= "1") is false'); |
| 25 |
assert.sameValue('-1' >= 1n, false, 'The result of ("-1" >= 1n) is false'); |
| 26 |
assert.sameValue(-1n >= '-1', true, 'The result of (-1n >= "-1") is true'); |
| 27 |
assert.sameValue('-1' >= -1n, true, 'The result of ("-1" >= -1n) is true'); |
| 28 |
|
| 29 |
assert.sameValue( |
| 30 |
9007199254740993n >= '9007199254740992', |
| 31 |
true, |
| 32 |
'The result of (9007199254740993n >= "9007199254740992") is true' |
| 33 |
); |
| 34 |
|
| 35 |
assert.sameValue( |
| 36 |
'9007199254740993' >= 9007199254740992n, |
| 37 |
true, |
| 38 |
'The result of ("9007199254740993" >= 9007199254740992n) is true' |
| 39 |
); |
| 40 |
|
| 41 |
assert.sameValue( |
| 42 |
-9007199254740992n >= '-9007199254740993', |
| 43 |
true, |
| 44 |
'The result of (-9007199254740992n >= "-9007199254740993") is true' |
| 45 |
); |
| 46 |
|
| 47 |
assert.sameValue( |
| 48 |
'-9007199254740992' >= -9007199254740993n, |
| 49 |
true, |
| 50 |
'The result of ("-9007199254740992" >= -9007199254740993n) is true' |
| 51 |
); |
| 52 |
|
| 53 |
reportCompare(0, 0); |