diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/harness/deepEqual-primitives.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/harness/deepEqual-primitives.js')
-rw-r--r-- | js/src/tests/test262/harness/deepEqual-primitives.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/js/src/tests/test262/harness/deepEqual-primitives.js b/js/src/tests/test262/harness/deepEqual-primitives.js new file mode 100644 index 0000000000..7d68de21a8 --- /dev/null +++ b/js/src/tests/test262/harness/deepEqual-primitives.js @@ -0,0 +1,36 @@ +// Copyright 2019 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + primitive values compare correctly. +includes: [deepEqual.js] +---*/ + +/// <reference path="../../harness/assert.js" /> +/// <reference path="../../harness/deepEqual.js" /> + +var s1 = Symbol(); +var s2 = Symbol(); +assert.deepEqual(null, null); +assert.deepEqual(undefined, undefined); +assert.deepEqual("a", "a"); +assert.deepEqual(1, 1); +assert.deepEqual(true, true); +assert.deepEqual(s1, s1); +assert.deepEqual(Object("a"), "a"); +assert.deepEqual(Object(1), 1); +assert.deepEqual(Object(true), true); +assert.deepEqual(Object(s1), s1); + +assert.throws(Test262Error, function () { assert.deepEqual(null, 0); }); +assert.throws(Test262Error, function () { assert.deepEqual(undefined, 0); }); +assert.throws(Test262Error, function () { assert.deepEqual("", 0); }); +assert.throws(Test262Error, function () { assert.deepEqual("1", 1); }); +assert.throws(Test262Error, function () { assert.deepEqual("1", "2"); }); +assert.throws(Test262Error, function () { assert.deepEqual(true, 1); }); +assert.throws(Test262Error, function () { assert.deepEqual(true, false); }); +assert.throws(Test262Error, function () { assert.deepEqual(s1, "Symbol()"); }); +assert.throws(Test262Error, function () { assert.deepEqual(s1, s2); }); + +reportCompare(0, 0); |