Debian Codegraph @

js/src/tests/test262/language/expressions/does-not-equals/bigint-and-non-finite.js

raw
1 // Copyright (C) 2017 Josh Wolfe. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 description: Non-strict inequality comparison of BigInt and non-finite Number values
5 esid: sec-abstract-equality-comparison
6 info: |
7 12. If Type(x) is BigInt and Type(y) is Number, or if Type(x) is Number and Type(y) is BigInt,
8 a. If x or y are any of NaN, +∞, or -∞, return false.
9
10 features: [BigInt]
11 ---*/
12 assert.sameValue(0n != Infinity, true, 'The result of (0n != Infinity) is true');
13 assert.sameValue(Infinity != 0n, true, 'The result of (Infinity != 0n) is true');
14 assert.sameValue(1n != Infinity, true, 'The result of (1n != Infinity) is true');
15 assert.sameValue(Infinity != 1n, true, 'The result of (Infinity != 1n) is true');
16 assert.sameValue(-1n != Infinity, true, 'The result of (-1n != Infinity) is true');
17 assert.sameValue(Infinity != -1n, true, 'The result of (Infinity != -1n) is true');
18 assert.sameValue(0n != -Infinity, true, 'The result of (0n != -Infinity) is true');
19 assert.sameValue(-Infinity != 0n, true, 'The result of (-Infinity != 0n) is true');
20 assert.sameValue(1n != -Infinity, true, 'The result of (1n != -Infinity) is true');
21 assert.sameValue(-Infinity != 1n, true, 'The result of (-Infinity != 1n) is true');
22 assert.sameValue(-1n != -Infinity, true, 'The result of (-1n != -Infinity) is true');
23 assert.sameValue(-Infinity != -1n, true, 'The result of (-Infinity != -1n) is true');
24 assert.sameValue(0n != NaN, true, 'The result of (0n != NaN) is true');
25 assert.sameValue(NaN != 0n, true, 'The result of (NaN != 0n) is true');
26 assert.sameValue(1n != NaN, true, 'The result of (1n != NaN) is true');
27 assert.sameValue(NaN != 1n, true, 'The result of (NaN != 1n) is true');
28 assert.sameValue(-1n != NaN, true, 'The result of (-1n != NaN) is true');
29 assert.sameValue(NaN != -1n, true, 'The result of (NaN != -1n) is true');
30
31 reportCompare(0, 0);