]> Lady’s Gitweb - Pisces/commitdiff
Test function lengths in {value∣function∣symbol}.js
authorLady <redacted>
Mon, 4 Sep 2023 22:37:35 +0000 (18:37 -0400)
committerLady <redacted>
Mon, 4 Sep 2023 22:37:35 +0000 (18:37 -0400)
function.test.js
symbol.test.js
value.test.js

index 75ba30008df964ac424e37518f40960576abcf1a..1165d03da1defd41ff58239b22e257090451762f 100644 (file)
@@ -77,6 +77,12 @@ describe("bind", () => {
     assertThrows(() => new bind(function () {}));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(bind.length, 3);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(bind.name, "bind");
@@ -133,6 +139,12 @@ describe("call", () => {
     assertThrows(() => new call(function () {}, null, []));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(call.length, 3);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(call.name, "call");
@@ -166,6 +178,12 @@ describe("completesNormally", () => {
     assertThrows(() => new completesNormally(function () {}));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(completesNormally.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(completesNormally.name, "completesNormally");
@@ -234,6 +252,12 @@ describe("construct", () => {
     assertThrows(() => new construct(function () {}, []));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(construct.length, 2);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(construct.name, "construct");
@@ -268,6 +292,12 @@ describe("createCallableFunction", () => {
     assertThrows(() => new createCallableFunction(function () {}));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(createCallableFunction.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(
@@ -374,6 +404,12 @@ describe("createIllegalConstructor", () => {
     });
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(createIllegalConstructor.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(
@@ -400,6 +436,12 @@ describe("identity", () => {
     assertStrictEquals(new class extends identity {}(value), value);
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(identity.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(identity.name, "identity");
@@ -466,6 +508,12 @@ describe("isCallable", () => {
     assertThrows(() => new isCallable(function () {}));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(isCallable.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(isCallable.name, "isCallable");
@@ -532,6 +580,12 @@ describe("isConstructor", () => {
     assertThrows(() => new isConstructor(function () {}));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(isConstructor.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(isConstructor.name, "isConstructor");
@@ -559,6 +613,12 @@ describe("ordinaryHasInstance", () => {
     assertThrows(() => new ordinaryHasInstance(function () {}, {}));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(ordinaryHasInstance.length, 2);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(
@@ -631,6 +691,12 @@ describe("toFunctionName", () => {
     assertThrows(() => new toFunctionName(""));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(toFunctionName.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(
index 38d74259e7b74f989aec5e331d0bee05848a4c30..03abffcf004730598788077bc913358705657c57 100644 (file)
@@ -39,6 +39,12 @@ describe("getSymbolDescription", () => {
     assertThrows(() => new getSymbolDescription(Symbol()));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(getSymbolDescription.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(
@@ -69,6 +75,12 @@ describe("symbolToString", () => {
     assertThrows(() => new symbolToString(Symbol()));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(symbolToString.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(
@@ -110,6 +122,12 @@ describe("symbolValue", () => {
     assertThrows(() => new symbolValue(Symbol()));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(symbolValue.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(
index 1be5950a4ba665c3b51356dfd13a78f692fc90a6..ae2b7d850793cdd139c7064124064e3ff6db687c 100644 (file)
@@ -206,6 +206,12 @@ describe("ordinaryToPrimitive", () => {
     assertThrows(() => new ordinaryToPrimitive(""));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(ordinaryToPrimitive.length, 2);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(
@@ -258,6 +264,12 @@ describe("sameValue", () => {
     assertThrows(() => new sameValue(true, true));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(sameValue.length, 2);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(sameValue.name, "sameValue");
@@ -310,6 +322,12 @@ describe("sameValueZero", () => {
     assertThrows(() => new sameValueZero(true, true));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(sameValueZero.length, 2);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(sameValueZero.name, "sameValueZero");
@@ -417,6 +435,12 @@ describe("toPrimitive", () => {
     assertThrows(() => new toPrimitive(true));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(toPrimitive.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(toPrimitive.name, "toPrimitive");
@@ -449,6 +473,12 @@ describe("type", () => {
     assertThrows(() => new type({}));
   });
 
+  describe(".length", () => {
+    it("[[Get]] returns the correct length", () => {
+      assertStrictEquals(type.length, 1);
+    });
+  });
+
   describe(".name", () => {
     it("[[Get]] returns the correct name", () => {
       assertStrictEquals(type.name, "type");
This page took 0.030616 seconds and 4 git commands to generate.