mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-28 12:18:56 +00:00
LibJS: Implement Temporal.PlainYearMonth.compare
This commit is contained in:
parent
092ec0cecf
commit
90ada407db
Notes:
sideshowbarker
2024-07-18 04:23:28 +09:00
Author: https://github.com/Lubrsi
Commit: 90ada407db
Pull-request: https://github.com/SerenityOS/serenity/pull/9907
Reviewed-by: https://github.com/IdanHo ✅
Reviewed-by: https://github.com/linusg ✅
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