-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4d8f01
commit 53e5ef8
Showing
6 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
test/built-ins/Temporal/Calendar/prototype/dateFromFields/one-of-era-erayear-undefined.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,16 @@ | ||
// 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.calendar.prototype.datefromfields | ||
description: Does not throw a RangeError if only one of era/eraYear fields is present | ||
features: [Temporal] | ||
includes: [temporalHelpers.js] | ||
---*/ | ||
|
||
const base = { year: 2000, month: 5, day: 2, era: 'ce' }; | ||
const instance = new Temporal.Calendar('iso8601'); | ||
TemporalHelpers.assertPlainDate(instance.dateFromFields({ ...base }), 2000, 5, 'M05', 2); | ||
|
||
const base2 = { year: 2000, month: 5, day: 2, eraYear: 1 }; | ||
TemporalHelpers.assertPlainDate(instance.dateFromFields({ ...base }), 2000, 5, 'M05', 2); |
16 changes: 16 additions & 0 deletions
16
.../built-ins/Temporal/Calendar/prototype/monthDayFromFields/one-of-era-erayear-undefined.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,16 @@ | ||
// 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.calendar.prototype.monthDayFromFields | ||
description: Does not throw a RangeError if only one of era/eraYear fields is present | ||
features: [Temporal] | ||
includes: [temporalHelpers.js] | ||
---*/ | ||
|
||
const base = { year: 2000, month: 5, day: 2, era: 'ce' }; | ||
const instance = new Temporal.Calendar('iso8601'); | ||
TemporalHelpers.assertPlainMonthDay(instance.monthDayFromFields({ ...base }), 'M05', 2); | ||
|
||
const base2 = { year: 2000, month: 5, day: 2, eraYear: 1 }; | ||
TemporalHelpers.assertPlainMonthDay(instance.monthDayFromFields({ ...base }), 'M05', 2); |
16 changes: 16 additions & 0 deletions
16
...built-ins/Temporal/Calendar/prototype/yearMonthFromFields/one-of-era-erayear-undefined.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,16 @@ | ||
// 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.calendar.prototype.yearMonthFromFields | ||
description: Does not throw a RangeError if only one of era/eraYear fields is present | ||
features: [Temporal] | ||
includes: [temporalHelpers.js] | ||
---*/ | ||
|
||
const base = { year: 2000, month: 5, day: 2, era: 'ce' }; | ||
const instance = new Temporal.Calendar('iso8601'); | ||
TemporalHelpers.assertPlainYearMonth(instance.yearMonthFromFields({ ...base }), 2000, 5, 'M05'); | ||
|
||
const base2 = { year: 2000, month: 5, day: 2, eraYear: 1 }; | ||
TemporalHelpers.assertPlainYearMonth(instance.yearMonthFromFields({ ...base }), 2000, 5, 'M05'); |
19 changes: 19 additions & 0 deletions
19
test/intl402/Temporal/Calendar/prototype/dateFromFields/one-of-era-erayear-undefined.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,19 @@ | ||
// 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.calendar.prototype.datefromfields | ||
description: Throw a RangeError if only one of era/eraYear fields is present | ||
features: [Temporal] | ||
---*/ | ||
|
||
const base = { year: 2000, month: 5, day: 2, era: 'ce' }; | ||
const instance = new Temporal.Calendar('gregory'); | ||
assert.throws(RangeError, () => { | ||
instance.dateFromFields({ ...base }); | ||
}); | ||
|
||
const base2 = { year: 2000, month: 5, day: 2, eraYear: 1 }; | ||
assert.throws(RangeError, () => { | ||
instance.dateFromFields({ ...base2 }); | ||
}); |
19 changes: 19 additions & 0 deletions
19
test/intl402/Temporal/Calendar/prototype/monthDayFromFields/one-of-era-erayear-undefined.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,19 @@ | ||
// 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.calendar.prototype.monthdayfromfields | ||
description: Throw a RangeError if only one of era/eraYear fields is present | ||
features: [Temporal] | ||
---*/ | ||
|
||
const base = { year: 2000, month: 5, day: 2, era: 'ce' }; | ||
const instance = new Temporal.Calendar('gregory'); | ||
assert.throws(RangeError, () => { | ||
instance.monthDayFromFields({ ...base }); | ||
}); | ||
|
||
const base2 = { year: 2000, month: 5, day: 2, eraYear: 1 }; | ||
assert.throws(RangeError, () => { | ||
instance.dateFromFields({ ...base2 }); | ||
}); |
19 changes: 19 additions & 0 deletions
19
test/intl402/Temporal/Calendar/prototype/yearMonthFromFields/one-of-era-erayear-undefined.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,19 @@ | ||
// 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.calendar.prototype.yearmonthfromfields | ||
description: Throw a RangeError if only one of era/eraYear fields is present | ||
features: [Temporal] | ||
---*/ | ||
|
||
const base = { year: 2000, month: 5, day: 2, era: 'ce' }; | ||
const instance = new Temporal.Calendar('gregory'); | ||
assert.throws(RangeError, () => { | ||
instance.yearMonthFromFields({ ...base }); | ||
}); | ||
|
||
const base2 = { year: 2000, month: 5, day: 2, eraYear: 1 }; | ||
assert.throws(RangeError, () => { | ||
instance.yearMonthFromFields({ ...base2 }); | ||
}); |