소스 검색

LibJS/Tests: Tweak PlainYearMonth Infinity test values

Since we want to test that +/- Infinity fails as an argument, we should
provide valid arguments for everything else - 0 for month isn't :^)
Linus Groh 3 년 전
부모
커밋
301d622b46
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainYearMonth/PlainYearMonth.js

+ 2 - 2
Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainYearMonth/PlainYearMonth.js

@@ -16,7 +16,7 @@ describe("errors", () => {
             new Temporal.PlainYearMonth(0, Infinity);
             new Temporal.PlainYearMonth(0, Infinity);
         }).toThrowWithMessage(RangeError, "Invalid plain year month");
         }).toThrowWithMessage(RangeError, "Invalid plain year month");
         expect(() => {
         expect(() => {
-            new Temporal.PlainYearMonth(0, 0, {}, Infinity);
+            new Temporal.PlainYearMonth(0, 1, {}, Infinity);
         }).toThrowWithMessage(RangeError, "Invalid plain year month");
         }).toThrowWithMessage(RangeError, "Invalid plain year month");
         expect(() => {
         expect(() => {
             new Temporal.PlainYearMonth(-Infinity);
             new Temporal.PlainYearMonth(-Infinity);
@@ -25,7 +25,7 @@ describe("errors", () => {
             new Temporal.PlainYearMonth(0, -Infinity);
             new Temporal.PlainYearMonth(0, -Infinity);
         }).toThrowWithMessage(RangeError, "Invalid plain year month");
         }).toThrowWithMessage(RangeError, "Invalid plain year month");
         expect(() => {
         expect(() => {
-            new Temporal.PlainYearMonth(0, 0, {}, -Infinity);
+            new Temporal.PlainYearMonth(0, 1, {}, -Infinity);
         }).toThrowWithMessage(RangeError, "Invalid plain year month");
         }).toThrowWithMessage(RangeError, "Invalid plain year month");
     });
     });