mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:47:45 +00:00
LibJS: Implement Temporal.PlainTime.compare()
This commit is contained in:
parent
a77cdc5f92
commit
684e62476b
3 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,13 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 2", () => {
|
||||
expect(Temporal.PlainTime.compare).toHaveLength(2);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const plainTime1 = new Temporal.PlainTime(16, 38, 40, 1, 2, 3);
|
||||
expect(Temporal.PlainTime.compare(plainTime1, plainTime1)).toBe(0);
|
||||
const plainTime2 = new Temporal.PlainTime(16, 39, 5, 0, 1, 2);
|
||||
expect(Temporal.PlainTime.compare(plainTime1, plainTime2)).toBe(-1);
|
||||
expect(Temporal.PlainTime.compare(plainTime2, plainTime1)).toBe(1);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue