Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/compare/exhaustive.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) 2023 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.instant.compare
7 description: Tests for compare() with each possible outcome
8 features: [Temporal]
9 ---*/
10
11 assert.sameValue(
12 Temporal.Instant.compare(new Temporal.Instant(1_000_000_000_000_000_000n), new Temporal.Instant(500_000_000_000_000_000n)),
13 1,
14 ">"
15 );
16 assert.sameValue(
17 Temporal.Instant.compare(new Temporal.Instant(-1000n), new Temporal.Instant(1000n)),
18 -1,
19 "<"
20 );
21 assert.sameValue(
22 Temporal.Instant.compare(new Temporal.Instant(123_456_789n), new Temporal.Instant(123_456_789n)),
23 0,
24 "="
25 );
26
27 reportCompare(0, 0);