mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 02:26:10 +00:00
LibJS: Add Temporal.Instant.compare()
This commit is contained in:
parent
b816037739
commit
33cf6274e8
Notes:
sideshowbarker
2024-07-18 09:10:15 +09:00
Author: https://github.com/IdanHo
Commit: 33cf6274e8
Pull-request: https://github.com/SerenityOS/serenity/pull/8663
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/linusg
6 changed files with 49 additions and 0 deletions
|
@ -0,0 +1,13 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 1", () => {
|
||||
expect(Temporal.Instant.compare).toHaveLength(2);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const instant1 = new Temporal.Instant(111n);
|
||||
expect(Temporal.Instant.compare(instant1, instant1)).toBe(0);
|
||||
const instant2 = new Temporal.Instant(999n);
|
||||
expect(Temporal.Instant.compare(instant1, instant2)).toBe(-1);
|
||||
expect(Temporal.Instant.compare(instant2, instant1)).toBe(1);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue