mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 12:06:07 +00:00
LibJS: Implement the Temporal.PlainYearMonth constructor
And the simple Temporal.PlainYearMonth.prototype getters, so that the constructed Temporal.PlainYearMonth may actually be validated.
This commit is contained in:
parent
1c733993e0
commit
b68d67693e
Notes:
github-actions[bot]
2024-11-22 18:56:56 +00:00
Author: https://github.com/trflynn89
Commit: b68d67693e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2496
27 changed files with 926 additions and 3 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