LibJS: Implement the Temporal.PlainDate constructor

And the simple Temporal.PlainDate.prototype getters, so that the
constructed Temporal.PlainDate may actually be validated.
This commit is contained in:
Timothy Flynn 2024-11-22 09:23:09 -05:00 committed by Andreas Kling
commit a0c55f76e7
Notes: github-actions[bot] 2024-11-23 13:48:20 +00:00
30 changed files with 856 additions and 0 deletions

View file

@ -0,0 +1,13 @@
describe("correct behavior", () => {
test("length is 2", () => {
expect(Temporal.PlainDate.compare).toHaveLength(2);
});
test("basic functionality", () => {
const plainDate1 = new Temporal.PlainDate(2021, 7, 26);
expect(Temporal.PlainDate.compare(plainDate1, plainDate1)).toBe(0);
const plainDate2 = new Temporal.PlainDate(2021, 7, 27);
expect(Temporal.PlainDate.compare(plainDate1, plainDate2)).toBe(-1);
expect(Temporal.PlainDate.compare(plainDate2, plainDate1)).toBe(1);
});
});