LibJS: Implement the Temporal.PlainTime constructor

And the simple Temporal.PlainTime.prototype getters, so that the
constructed Temporal.PlainTime may actually be validated.
This commit is contained in:
Timothy Flynn 2024-11-23 10:21:21 -05:00 committed by Tim Flynn
commit 66365fef57
Notes: github-actions[bot] 2024-11-24 00:38:03 +00:00
22 changed files with 693 additions and 1 deletions

View file

@ -0,0 +1,13 @@
describe("correct behavior", () => {
test("length is 2", () => {
expect(Temporal.PlainTime.compare).toHaveLength(2);
});
test("basic functionality", () => {
const plainTime1 = new Temporal.PlainTime(16, 38, 40, 1, 2, 3);
expect(Temporal.PlainTime.compare(plainTime1, plainTime1)).toBe(0);
const plainTime2 = new Temporal.PlainTime(16, 39, 5, 0, 1, 2);
expect(Temporal.PlainTime.compare(plainTime1, plainTime2)).toBe(-1);
expect(Temporal.PlainTime.compare(plainTime2, plainTime1)).toBe(1);
});
});