mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:27:35 +00:00
LibJS: Implement Temporal.PlainDate.compare
This commit is contained in:
parent
2c6bd3a61b
commit
07485802c6
5 changed files with 67 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue