Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainTime/compare/basic.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2022 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.plaintime.compare
7 description: Basic tests for compare()
8 features: [Temporal]
9 ---*/
10
11 const t1 = Temporal.PlainTime.from("08:44:15.321");
12 const t1bis = Temporal.PlainTime.from("08:44:15.321");
13 const t2 = Temporal.PlainTime.from("14:23:30.123");
14
15 assert.sameValue(Temporal.PlainTime.compare(t1, t1), 0, "same object");
16 assert.sameValue(Temporal.PlainTime.compare(t1, t1bis), 0, "different object");
17 assert.sameValue(Temporal.PlainTime.compare(t1, t2), -1, "before");
18 assert.sameValue(Temporal.PlainTime.compare(t2, t1), 1, "after");
19
20 reportCompare(0, 0);