X-Git-Url: https://git.ladys.computer/Pisces/blobdiff_plain/7c3a2eda590637af9463e5a59ab798f802d274a9..83f6aae0d1b8181dc2b0c6ccdba9f2fe2fdba3e6:/value.test.js diff --git a/value.test.js b/value.test.js index 6729b85..df86778 100644 --- a/value.test.js +++ b/value.test.js @@ -1,7 +1,7 @@ // ♓🌟 Piscēs ∷ value.test.js // ==================================================================== // -// Copyright © 2022 Lady [@ Lady’s Computer]. +// Copyright © 2022–2023 Lady [@ Lady’s Computer]. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -15,27 +15,114 @@ import { it, } from "./dev-deps.js"; import { + ASYNC_ITERATOR, + HAS_INSTANCE, + IS_CONCAT_SPREADABLE, + ITERATOR, + MATCH, + MATCH_ALL, NULL, ordinaryToPrimitive, + REPLACE, sameValue, sameValueZero, + SPECIES, + SPLIT, + TO_PRIMITIVE, + TO_STRING_TAG, toPrimitive, type, UNDEFINED, + UNSCOPABLES, } from "./value.js"; +describe("ASYNC_ITERATOR", () => { + it("[[Get]] is @@asyncIterator", () => { + assertStrictEquals(ASYNC_ITERATOR, Symbol.asyncIterator); + }); +}); + +describe("HAS_INSTANCE", () => { + it("[[Get]] is @@hasInstance", () => { + assertStrictEquals(HAS_INSTANCE, Symbol.hasInstance); + }); +}); + +describe("IS_CONCAT_SPREADABLE", () => { + it("[[Get]] is @@isConcatSpreadable", () => { + assertStrictEquals( + IS_CONCAT_SPREADABLE, + Symbol.isConcatSpreadable, + ); + }); +}); + +describe("ITERATOR", () => { + it("[[Get]] is @@iterator", () => { + assertStrictEquals(ITERATOR, Symbol.iterator); + }); +}); + +describe("MATCH", () => { + it("[[Get]] is @@match", () => { + assertStrictEquals(MATCH, Symbol.match); + }); +}); + +describe("MATCH_ALL", () => { + it("[[Get]] is @@matchAll", () => { + assertStrictEquals(MATCH_ALL, Symbol.matchAll); + }); +}); + describe("NULL", () => { it("[[Get]] is null", () => { assertStrictEquals(NULL, null); }); }); +describe("REPLACE", () => { + it("[[Get]] is @@replace", () => { + assertStrictEquals(REPLACE, Symbol.replace); + }); +}); + +describe("SPECIES", () => { + it("[[Get]] is @@species", () => { + assertStrictEquals(SPECIES, Symbol.species); + }); +}); + +describe("SPLIT", () => { + it("[[Get]] is @@split", () => { + assertStrictEquals(SPLIT, Symbol.split); + }); +}); + +describe("TO_PRIMITIVE", () => { + it("[[Get]] is @@toPrimitive", () => { + assertStrictEquals(TO_PRIMITIVE, Symbol.toPrimitive); + }); +}); + +describe("TO_STRING_TAG", () => { + it("[[Get]] is @@toStringTag", () => { + assertStrictEquals(TO_STRING_TAG, Symbol.toStringTag); + }); +}); + describe("UNDEFINED", () => { it("[[Get]] is undefined", () => { assertStrictEquals(UNDEFINED, void {}); }); }); +describe("UNSCOPABLES", () => { + it("[[Get]] is @@unscopables", () => { + assertStrictEquals(UNSCOPABLES, Symbol.unscopables); + }); +}); + describe("ordinaryToPrimitive", () => { it("[[Call]] prefers `valueOf` by default", () => { const obj = {