// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
import {
- assert,
assertStrictEquals,
assertThrows,
describe,
describe("sameValue", () => {
it("[[Call]] returns false for null π undefined", () => {
- assert(!sameValue(null, void {}));
+ assertStrictEquals(sameValue(null, undefined), false);
});
it("[[Call]] returns false for null π an object", () => {
- assert(!sameValue(null, {}));
+ assertStrictEquals(sameValue(null, {}), false);
});
it("[[Call]] returns true for null π null", () => {
- assert(sameValue(null, null));
+ assertStrictEquals(sameValue(null, null), true);
});
it("[[Call]] returns false for two different objects", () => {
- assert(!sameValue({}, {}));
+ assertStrictEquals(sameValue({}, {}), false);
});
it("[[Call]] returns true for the same object", () => {
const obj = {};
- assert(sameValue(obj, obj));
+ assertStrictEquals(sameValue(obj, obj), true);
});
it("[[Call]] returns false for Β±0", () => {
- assert(!sameValue(0, -0));
+ assertStrictEquals(sameValue(0, -0), false);
});
it("[[Call]] returns true for -0", () => {
- assert(sameValue(-0, -0));
+ assertStrictEquals(sameValue(-0, -0), true);
});
it("[[Call]] returns true for nan", () => {
- assert(sameValue(0 / 0, 0 / 0));
+ assertStrictEquals(sameValue(0 / 0, 0 / 0), true);
});
it("[[Call]] returns false for a primitive and its wrapped object", () => {
- assert(!sameValue(false, new Boolean(false)));
+ assertStrictEquals(sameValue(false, new Boolean(false)), false);
});
});
describe("sameValueZero", () => {
it("[[Call]] returns false for null π undefined", () => {
- assert(!sameValueZero(null, void {}));
+ assertStrictEquals(sameValueZero(null, undefined), false);
});
it("[[Call]] returns false for null π an object", () => {
- assert(!sameValueZero(null, {}));
+ assertStrictEquals(sameValueZero(null, {}), false);
});
it("[[Call]] returns true for null π null", () => {
- assert(sameValueZero(null, null));
+ assertStrictEquals(sameValueZero(null, null), true);
});
it("[[Call]] returns false for two different objects", () => {
- assert(!sameValueZero({}, {}));
+ assertStrictEquals(sameValueZero({}, {}), false);
});
it("[[Call]] returns true for the same object", () => {
const obj = {};
- assert(sameValueZero(obj, obj));
+ assertStrictEquals(sameValueZero(obj, obj), true);
});
it("[[Call]] returns true for Β±0", () => {
- assert(sameValueZero(0, -0));
+ assertStrictEquals(sameValueZero(0, -0), true);
});
it("[[Call]] returns true for -0", () => {
- assert(sameValueZero(-0, -0));
+ assertStrictEquals(sameValueZero(-0, -0), true);
});
it("[[Call]] returns true for nan", () => {
- assert(sameValueZero(0 / 0, 0 / 0));
+ assertStrictEquals(sameValueZero(0 / 0, 0 / 0), true);
});
it("[[Call]] returns false for a primitive and its wrapped object", () => {
- assert(!sameValueZero(false, new Boolean(false)));
+ assertStrictEquals(
+ sameValueZero(false, new Boolean(false)),
+ false,
+ );
});
});