Debian Codegraph @

js/src/tests/test262/language/expressions/strict-does-not-equals/bigint-and-string.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: Strict inequality comparison of BigInt and String values
5 esid: sec-strict-equality-comparison
6 info: |
7 1. If Type(x) is different from Type(y), return false.
8
9 features: [BigInt]
10 ---*/
11 assert.sameValue(0n !== '', true, 'The result of (0n !== "") is true');
12 assert.sameValue('' !== 0n, true, 'The result of ("" !== 0n) is true');
13 assert.sameValue(0n !== '-0', true, 'The result of (0n !== "-0") is true');
14 assert.sameValue('-0' !== 0n, true, 'The result of ("-0" !== 0n) is true');
15 assert.sameValue(0n !== '0', true, 'The result of (0n !== "0") is true');
16 assert.sameValue('0' !== 0n, true, 'The result of ("0" !== 0n) is true');
17 assert.sameValue(0n !== '-1', true, 'The result of (0n !== "-1") is true');
18 assert.sameValue('-1' !== 0n, true, 'The result of ("-1" !== 0n) is true');
19 assert.sameValue(0n !== '1', true, 'The result of (0n !== "1") is true');
20 assert.sameValue('1' !== 0n, true, 'The result of ("1" !== 0n) is true');
21 assert.sameValue(0n !== 'foo', true, 'The result of (0n !== "foo") is true');
22 assert.sameValue('foo' !== 0n, true, 'The result of ("foo" !== 0n) is true');
23 assert.sameValue(1n !== '', true, 'The result of (1n !== "") is true');
24 assert.sameValue('' !== 1n, true, 'The result of ("" !== 1n) is true');
25 assert.sameValue(1n !== '-0', true, 'The result of (1n !== "-0") is true');
26 assert.sameValue('-0' !== 1n, true, 'The result of ("-0" !== 1n) is true');
27 assert.sameValue(1n !== '0', true, 'The result of (1n !== "0") is true');
28 assert.sameValue('0' !== 1n, true, 'The result of ("0" !== 1n) is true');
29 assert.sameValue(1n !== '-1', true, 'The result of (1n !== "-1") is true');
30 assert.sameValue('-1' !== 1n, true, 'The result of ("-1" !== 1n) is true');
31 assert.sameValue(1n !== '1', true, 'The result of (1n !== "1") is true');
32 assert.sameValue('1' !== 1n, true, 'The result of ("1" !== 1n) is true');
33 assert.sameValue(1n !== 'foo', true, 'The result of (1n !== "foo") is true');
34 assert.sameValue('foo' !== 1n, true, 'The result of ("foo" !== 1n) is true');
35 assert.sameValue(-1n !== '-', true, 'The result of (-1n !== "-") is true');
36 assert.sameValue('-' !== -1n, true, 'The result of ("-" !== -1n) is true');
37 assert.sameValue(-1n !== '-0', true, 'The result of (-1n !== "-0") is true');
38 assert.sameValue('-0' !== -1n, true, 'The result of ("-0" !== -1n) is true');
39 assert.sameValue(-1n !== '-1', true, 'The result of (-1n !== "-1") is true');
40 assert.sameValue('-1' !== -1n, true, 'The result of ("-1" !== -1n) is true');
41 assert.sameValue(-1n !== '-foo', true, 'The result of (-1n !== "-foo") is true');
42 assert.sameValue('-foo' !== -1n, true, 'The result of ("-foo" !== -1n) is true');
43
44 assert.sameValue(
45 900719925474099101n !== '900719925474099101',
46 true,
47 'The result of (900719925474099101n !== "900719925474099101") is true'
48 );
49
50 assert.sameValue(
51 '900719925474099101' !== 900719925474099101n,
52 true,
53 'The result of ("900719925474099101" !== 900719925474099101n) is true'
54 );
55
56 assert.sameValue(
57 900719925474099102n !== '900719925474099101',
58 true,
59 'The result of (900719925474099102n !== "900719925474099101") is true'
60 );
61
62 assert.sameValue(
63 '900719925474099101' !== 900719925474099102n,
64 true,
65 'The result of ("900719925474099101" !== 900719925474099102n) is true'
66 );
67
68 reportCompare(0, 0);