mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
Without custom calendars and time zones there are actually a bunch of things that we now can't test on implementations that don't have non-ISO calendars or non-UTC time zones. (Alternatively, we can say that these are functionalities that those implementations don't have to implement.)
18 lines
902 B
JavaScript
18 lines
902 B
JavaScript
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-temporal.plaindatetime.compare
|
|
description: Calendar is not taken into account for the comparison.
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const dt1 = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, "iso8601");
|
|
const dt2 = new Temporal.PlainDateTime(2019, 10, 29, 10, 46, 38, 271, 986, 102, "iso8601");
|
|
const dt3 = new Temporal.PlainDateTime(2019, 10, 29, 10, 46, 38, 271, 986, 102, "iso8601");
|
|
const dt4 = new Temporal.PlainDateTime(2019, 10, 29, 10, 46, 38, 271, 986, 102, "gregory");
|
|
|
|
assert.sameValue(Temporal.PlainDateTime.compare(dt1, dt2), -1, "smaller");
|
|
assert.sameValue(Temporal.PlainDateTime.compare(dt2, dt3), 0, "equal with same calendar");
|
|
assert.sameValue(Temporal.PlainDateTime.compare(dt2, dt4), 0, "equal with different calendar");
|