-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for PlainDate.from() with the Gregorian calendar.
- Loading branch information
Showing
3 changed files
with
29 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
polyfill/test/intl402/Temporal/PlainDate/constructor/from/basic.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2021 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.plaindate.from | ||
description: Basic tests for PlainDate.from() with the Gregorian calendar. | ||
includes: [compareArray.js, temporalHelpers.js] | ||
features: [Temporal] | ||
---*/ | ||
|
||
TemporalHelpers.assertPlainDate( | ||
Temporal.PlainDate.from("1999-12-31[u-ca=gregory]"), | ||
1999, 12, "M12", 31, "string era CE", "ce", 1999); | ||
|
||
TemporalHelpers.assertPlainDate( | ||
Temporal.PlainDate.from("-000001-12-31[u-ca=gregory]"), | ||
-1, 12, "M12", 31, "string era BCE", "bce", 2); | ||
|
||
TemporalHelpers.assertPlainDate( | ||
Temporal.PlainDate.from({ era: "ce", eraYear: 1999, month: 12, day: 31, calendar: "gregory" }), | ||
1999, 12, "M12", 31, "property bag explicit era CE", "ce", 1999); | ||
|
||
TemporalHelpers.assertPlainDate( | ||
Temporal.PlainDate.from({ year: 1999, month: 12, day: 31, calendar: "gregory" }), | ||
1999, 12, "M12", 31, "property bag implicit era CE", "ce", 1999); | ||
|
||
TemporalHelpers.assertPlainDate( | ||
Temporal.PlainDate.from({ era: "bce", eraYear: 2, month: 12, day: 31, calendar: "gregory" }), | ||
-1, 12, "M12", 31, "property bag era BCE", "bce", 2); |