diff --git a/test/built-ins/Temporal/PlainDate/prototype/daysInYear/basic.js b/test/built-ins/Temporal/PlainDate/prototype/daysInYear/basic.js new file mode 100644 index 0000000000..a2baf7200c --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/daysInYear/basic.js @@ -0,0 +1,11 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-get-temporal.plaindate.prototype.daysinyear +description: Basic tests for daysInYear. +features: [Temporal] +---*/ + +assert.sameValue((new Temporal.PlainDate(1976, 11, 18)).daysInYear, 366, "leap year"); +assert.sameValue((new Temporal.PlainDate(1977, 11, 18)).daysInYear, 365, "non-leap year"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/inLeapYear/basic.js b/test/built-ins/Temporal/PlainDate/prototype/inLeapYear/basic.js new file mode 100644 index 0000000000..f6def8ca81 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/inLeapYear/basic.js @@ -0,0 +1,13 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-get-temporal.plaindate.prototype.inleapyear +description: Basic test for inLeapYear +features: [Temporal] +---*/ + +assert.sameValue((new Temporal.PlainDate(1976, 11, 18)).inLeapYear, + true, "leap year"); +assert.sameValue((new Temporal.PlainDate(1977, 11, 18)).inLeapYear, + false, "non-leap year"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/basic.js index d3c7a5d8a9..25b7778377 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/basic.js @@ -7,6 +7,7 @@ description: Checking days in year for a "normal" case (non-undefined, non-bound features: [Temporal] ---*/ -const calendar = Temporal.Calendar.from("iso8601"); -const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar); -assert.sameValue(datetime.daysInYear, 366, "check days in year information"); +assert.sameValue((new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789)).daysInYear, + 366, "leap year"); +assert.sameValue((new Temporal.PlainDateTime(1977, 11, 18, 15, 23, 30, 123, 456, 789)).daysInYear, + 365, "non-leap year"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/inLeapYear/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/inLeapYear/basic.js new file mode 100644 index 0000000000..b620522f32 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/inLeapYear/basic.js @@ -0,0 +1,13 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-get-temporal.plaindatetime.prototype.inleapyear +description: Basic test for inLeapYear +features: [Temporal] +---*/ + +assert.sameValue((new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789)).inLeapYear, + true, "leap year"); +assert.sameValue((new Temporal.PlainDateTime(1977, 11, 18, 15, 23, 30, 123, 456, 789)).inLeapYear, + false, "non-leap year"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/daysInYear/basic.js b/test/built-ins/Temporal/PlainYearMonth/prototype/daysInYear/basic.js index f17cde06c5..1f3679b60f 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/daysInYear/basic.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/daysInYear/basic.js @@ -7,5 +7,5 @@ description: daysInYear works features: [Temporal] ---*/ -const ym = new Temporal.PlainYearMonth(1976, 11); -assert.sameValue(ym.daysInYear, 366); +assert.sameValue((new Temporal.PlainYearMonth(1976, 11)).daysInYear, 366, "leap year"); +assert.sameValue((new Temporal.PlainYearMonth(1977, 11)).daysInYear, 365, "non-leap year"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/inLeapYear/basic.js b/test/built-ins/Temporal/PlainYearMonth/prototype/inLeapYear/basic.js new file mode 100644 index 0000000000..00cc891761 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/inLeapYear/basic.js @@ -0,0 +1,13 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-get-temporal.plainyearmonth.prototype.inleapyear +description: Basic test for inLeapYear +features: [Temporal] +---*/ + +assert.sameValue((new Temporal.PlainYearMonth(1976, 11)).inLeapYear, + true, "leap year"); +assert.sameValue((new Temporal.PlainYearMonth(1977, 11)).inLeapYear, + false, "non-leap year"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/daysInYear/basic.js b/test/built-ins/Temporal/ZonedDateTime/prototype/daysInYear/basic.js new file mode 100644 index 0000000000..432e32d38b --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/daysInYear/basic.js @@ -0,0 +1,13 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-get-temporal.zoneddatetime.prototype.daysinyear +description: Checking days in year for a "normal" case (non-undefined, non-boundary case, etc.) +features: [Temporal] +---*/ + +assert.sameValue((new Temporal.ZonedDateTime(217178610123456789n, "UTC")).daysInYear, + 366, "leap year"); +assert.sameValue((new Temporal.ZonedDateTime(248714610123456789n, "UTC")).daysInYear, + 365, "non-leap year"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/inLeapYear/basic.js b/test/built-ins/Temporal/ZonedDateTime/prototype/inLeapYear/basic.js new file mode 100644 index 0000000000..5ea775944f --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/inLeapYear/basic.js @@ -0,0 +1,13 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-get-temporal.zoneddatetime.prototype.inleapyear +description: Basic test for inLeapYear +features: [Temporal] +---*/ + +assert.sameValue((new Temporal.ZonedDateTime(217178610123456789n, "UTC")).inLeapYear, + true, "leap year"); +assert.sameValue((new Temporal.ZonedDateTime(248714610123456789n, "UTC")).inLeapYear, + false, "non-leap year");