mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:17:44 +00:00
LibJS: Implement Temporal.PlainYearMonth.compare
This commit is contained in:
parent
092ec0cecf
commit
90ada407db
3 changed files with 35 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 2", () => {
|
||||
expect(Temporal.PlainYearMonth.compare).toHaveLength(2);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const plainYearMonth1 = new Temporal.PlainYearMonth(2021, 8);
|
||||
expect(Temporal.PlainYearMonth.compare(plainYearMonth1, plainYearMonth1)).toBe(0);
|
||||
const plainYearMonth2 = new Temporal.PlainYearMonth(2021, 9);
|
||||
expect(Temporal.PlainYearMonth.compare(plainYearMonth2, plainYearMonth2)).toBe(0);
|
||||
expect(Temporal.PlainYearMonth.compare(plainYearMonth1, plainYearMonth2)).toBe(-1);
|
||||
expect(Temporal.PlainYearMonth.compare(plainYearMonth2, plainYearMonth1)).toBe(1);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue