forked from tc39/test262
-
Notifications
You must be signed in to change notification settings - Fork 0
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 Temporal.Calendar.p*.monthsInYear
(Philip, March 2022: This was originally Frank's PR tc39#3059. I did some reformatting, removed duplicate tests, and combined with some existing tests.)
- Loading branch information
1 parent
c6145fa
commit d267660
Showing
3 changed files
with
32 additions
and
12 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-string.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,18 @@ | ||
// Copyright (C) 2021 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.calendar.prototype.monthsinyear | ||
description: An ISO 8601 date string should be converted as input | ||
info: | | ||
a. Perform ? ToTemporalDate(temporalDateLike). | ||
5. Return 12𝔽. | ||
features: [Temporal] | ||
---*/ | ||
|
||
let cal = new Temporal.Calendar("iso8601"); | ||
|
||
assert.sameValue(cal.monthsInYear("3456-12-20"), 12); | ||
assert.sameValue(cal.monthsInYear("+000998-01-28"), 12); | ||
assert.sameValue(cal.monthsInYear("3456-12-20T03:04:05+00:00[UTC]"), 12); | ||
assert.sameValue(cal.monthsInYear("+000998-01-28T03:04:05+00:00[UTC]"), 12); |
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 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