Skip to content

Commit 644a599

Browse files
catamorphismptomato
authored andcommitted
Add extra test for Persian calendar
1 parent bb87cea commit 644a599

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

test/intl402/Temporal/PlainDate/prototype/since/wrapping-at-end-of-month-persian.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const calendar = "persian";
3636
0, -1, 0, 0, 0, 0, 0, 0, 0, 0,
3737
`Bahman 29th to Esfand 29th is one month (${largestUnit})`
3838
);
39+
TemporalHelpers.assertDuration(
40+
Temporal.PlainDate.from({ year: 1400, monthCode: "M11", day: 30, calendar }).since(end, { largestUnit }),
41+
0, 0, 0, -29, 0, 0, 0, 0, 0, 0,
42+
`Bahman 30th to Esfand 29th is 29 days (${largestUnit})`
43+
);
3944
}
4045
}
4146

test/intl402/Temporal/PlainDate/prototype/until/wrapping-at-end-of-month-persian.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const calendar = "persian";
3636
0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
3737
`Bahman 29th to Esfand 29th is one month (${largestUnit})`
3838
);
39+
TemporalHelpers.assertDuration(
40+
Temporal.PlainDate.from({ year: 1400, monthCode: "M11", day: 30, calendar }).until(end, { largestUnit }),
41+
0, 0, 0, 29, 0, 0, 0, 0, 0, 0,
42+
`Bahman 30th to Esfand 29th is 29 days (${largestUnit})`
43+
);
3944
}
4045
}
4146

test/intl402/Temporal/PlainDateTime/prototype/since/wrapping-at-end-of-month-persian.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const calendar = "persian";
3636
0, -1, 0, 0, 0, 0, 0, 0, 0, 0,
3737
`Bahman 29th to Esfand 29th is one month (${largestUnit})`
3838
);
39+
TemporalHelpers.assertDuration(
40+
Temporal.PlainDateTime.from({ year: 1400, monthCode: "M11", day: 30, hour: 12, minute: 34, calendar }).since(end, { largestUnit }),
41+
0, 0, 0, -29, 0, 0, 0, 0, 0, 0,
42+
`Bahman 30th to Esfand 29th is 29 days (${largestUnit})`
43+
);
3944
}
4045
}
4146

test/intl402/Temporal/PlainDateTime/prototype/until/wrapping-at-end-of-month-persian.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const calendar = "persian";
3636
0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
3737
`Bahman 29th to Esfand 29th is one month (${largestUnit})`
3838
);
39+
TemporalHelpers.assertDuration(
40+
Temporal.PlainDateTime.from({ year: 1400, monthCode: "M11", day: 30, hour: 12, minute: 34, calendar }).until(end, { largestUnit }),
41+
0, 0, 0, 29, 0, 0, 0, 0, 0, 0,
42+
`Bahman 30th to Esfand 29th is 29 days (${largestUnit})`
43+
);
3944
}
4045
}
4146

test/intl402/Temporal/ZonedDateTime/prototype/since/wrapping-at-end-of-month-persian.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const calendar = "persian";
3636
0, -1, 0, 0, 0, 0, 0, 0, 0, 0,
3737
`Bahman 29th to Esfand 29th is one month (${largestUnit})`
3838
);
39+
TemporalHelpers.assertDuration(
40+
Temporal.ZonedDateTime.from({ year: 1400, monthCode: "M11", day: 30, hour: 12, minute: 34, timeZone: "UTC", calendar }).since(end, { largestUnit }),
41+
0, 0, 0, -29, 0, 0, 0, 0, 0, 0,
42+
`Bahman 30th to Esfand 29th is 29 days (${largestUnit})`
43+
);
3944
}
4045
}
4146

test/intl402/Temporal/ZonedDateTime/prototype/until/wrapping-at-end-of-month-persian.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const calendar = "persian";
3636
0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
3737
`Bahman 29th to Esfand 29th is one month (${largestUnit})`
3838
);
39+
TemporalHelpers.assertDuration(
40+
Temporal.ZonedDateTime.from({ year: 1400, monthCode: "M11", day: 30, hour: 12, minute: 34, timeZone: "UTC", calendar }).until(end, { largestUnit }),
41+
0, 0, 0, 29, 0, 0, 0, 0, 0, 0,
42+
`Bahman 30th to Esfand 29th is 29 days (${largestUnit})`
43+
);
3944
}
4045
}
4146

0 commit comments

Comments
 (0)