mirror of
https://github.com/tc39/test262.git
synced 2025-08-14 06:28:24 +02:00
This adds coverage for each possible outcome of compare(), where each unit is greater, lesser, or equal.
25 lines
667 B
JavaScript
25 lines
667 B
JavaScript
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-temporal.instant.compare
|
|
description: Tests for compare() with each possible outcome
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
assert.sameValue(
|
|
Temporal.Instant.compare(new Temporal.Instant(1_000_000_000_000_000_000n), new Temporal.Instant(500_000_000_000_000_000n)),
|
|
1,
|
|
">"
|
|
);
|
|
assert.sameValue(
|
|
Temporal.Instant.compare(new Temporal.Instant(-1000n), new Temporal.Instant(1000n)),
|
|
-1,
|
|
"<"
|
|
);
|
|
assert.sameValue(
|
|
Temporal.Instant.compare(new Temporal.Instant(123_456_789n), new Temporal.Instant(123_456_789n)),
|
|
0,
|
|
"="
|
|
);
|