My working unpac space for OCaml projects in development
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Intl Era Monthcode: Adapt PlainDate.since/until tests to PlainYearMonth

This commit copies all of the PlainDate.since and .until tests that
would apply to PlainYearMonth, and adapts them where necessary.

authored by

Philip Chimento and committed by
Ms2ger
f4aadbd5 efa8b23e

+8691
+203
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-buddhist.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (buddhist calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "buddhist"; 14 + 15 + const date250302 = Temporal.PlainYearMonth.from({ year: 2503, monthCode: "M02", calendar }); 16 + const date250303 = Temporal.PlainYearMonth.from({ year: 2503, monthCode: "M03", calendar }); 17 + const date251207 = Temporal.PlainYearMonth.from({ year: 2512, monthCode: "M07", calendar }); 18 + const date254007 = Temporal.PlainYearMonth.from({ year: 2540, monthCode: "M07", calendar }); 19 + const date254012 = Temporal.PlainYearMonth.from({ year: 2540, monthCode: "M12", calendar }); 20 + const date255512 = Temporal.PlainYearMonth.from({ year: 2555, monthCode: "M12", calendar }); 21 + const date255606 = Temporal.PlainYearMonth.from({ year: 2556, monthCode: "M06", calendar }); 22 + const date255906 = Temporal.PlainYearMonth.from({ year: 2559, monthCode: "M06", calendar }); 23 + const date256207 = Temporal.PlainYearMonth.from({ year: 2562, monthCode: "M07", calendar }); 24 + const date256212 = Temporal.PlainYearMonth.from({ year: 2562, monthCode: "M12", calendar }); 25 + const date256303 = Temporal.PlainYearMonth.from({ year: 2563, monthCode: "M03", calendar }); 26 + const date256312 = Temporal.PlainYearMonth.from({ year: 2563, monthCode: "M12", calendar }); 27 + const date256401 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M01", calendar }); 28 + const date256403 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M03", calendar }); 29 + const date256407 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M07", calendar }); 30 + const date256408 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M08", calendar }); 31 + const date256409 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M09", calendar }); 32 + const date256507 = Temporal.PlainYearMonth.from({ year: 2565, monthCode: "M07", calendar }); 33 + const date256509 = Temporal.PlainYearMonth.from({ year: 2565, monthCode: "M09", calendar }); 34 + const date257407 = Temporal.PlainYearMonth.from({ year: 2574, monthCode: "M07", calendar }); 35 + const date257412 = Temporal.PlainYearMonth.from({ year: 2574, monthCode: "M12", calendar }); 36 + 37 + const tests = [ 38 + [ 39 + date256407, date256407, "same month", 40 + ["years", 0, 0], 41 + ["months", 0, 0], 42 + ], 43 + [ 44 + date256407, date256408, "1 month in same year", 45 + ["years", 0, -1], 46 + ["months", 0, -1], 47 + ], 48 + [ 49 + date256312, date256401, "1 month in different year", 50 + ["years", 0, -1], 51 + ["months", 0, -1], 52 + ], 53 + [ 54 + date256407, date256409, "2 months which both have 31 days", 55 + ["years", 0, -2], 56 + ["months", 0, -2], 57 + ], 58 + [ 59 + date256407, date256507, "1 year", 60 + ["years", -1, 0], 61 + ["months", 0, -12], 62 + ], 63 + [ 64 + date256407, date257407, "10 years", 65 + ["years", -10, 0], 66 + ["months", 0, -120], 67 + ], 68 + [ 69 + date256407, date256509, "1 year 2 months", 70 + ["years", -1, -2], 71 + ], 72 + [ 73 + date256407, date257412, "10 years and 5 months", 74 + ["years", -10, -5], 75 + ], 76 + [ 77 + date254012, date256407, "23 years and 7 months", 78 + ["years", -23, -7], 79 + ], 80 + [ 81 + date254007, date256407, "24 years", 82 + ["years", -24, 0], 83 + ], 84 + [ 85 + date250302, date256303, "60 years, 1 month", 86 + ["years", -60, -1], 87 + ], 88 + [ 89 + date256403, date256407, "4 months", 90 + ["years", 0, -4], 91 + ], 92 + [ 93 + date256303, date256407, "1 year, 4 months", 94 + ["years", -1, -4], 95 + ], 96 + [ 97 + date250303, date256407, "61 years, 4 months", 98 + ["years", -61, -4], 99 + ], 100 + [ 101 + date256212, date256407, "1 year, 7 months", 102 + ["years", -1, -7], 103 + ], 104 + [ 105 + date255512, date255606, "6 months", 106 + ["months", 0, -6], 107 + ], 108 + [ 109 + date256212, date256403, "1 year, 3 months", 110 + ["years", -1, -3], 111 + ], 112 + [ 113 + date255512, date255906, "3 years, 6 months", 114 + ["years", -3, -6], 115 + ], 116 + [ 117 + date251207, date256207, "crossing epoch", 118 + ["years", -50, 0], 119 + ], 120 + [ 121 + date256408, date256407, "negative 1 month in same year", 122 + ["years", 0, 1], 123 + ["months", 0, 1], 124 + ], 125 + [ 126 + date256401, date256312, "negative 1 month in different year", 127 + ["years", 0, 1], 128 + ["months", 0, 1], 129 + ], 130 + [ 131 + date256409, date256407, "negative 2 months which both have 31 days", 132 + ["years", 0, 2], 133 + ["months", 0, 2], 134 + ], 135 + [ 136 + date256507, date256407, "negative 1 year", 137 + ["years", 1, 0], 138 + ["months", 0, 12], 139 + ], 140 + [ 141 + date257407, date256407, "negative 10 years", 142 + ["years", 10, 0], 143 + ["months", 0, 120], 144 + ], 145 + [ 146 + date256509, date256407, "negative 1 year 2 months", 147 + ["years", 1, 2], 148 + ], 149 + [ 150 + date257412, date256407, "negative 10 years and 5 months", 151 + ["years", 10, 5], 152 + ], 153 + [ 154 + date256407, date254012, "negative 23 years and 7 months", 155 + ["years", 23, 7], 156 + ], 157 + [ 158 + date256407, date254007, "negative 24 years", 159 + ["years", 24, 0], 160 + ], 161 + [ 162 + date256303, date250302, "negative 60 years, 1 month", 163 + ["years", 60, 1], 164 + ], 165 + [ 166 + date256407, date256403, "negative 4 months", 167 + ["years", 0, 4], 168 + ], 169 + [ 170 + date256407, date256303, "negative 1 year, 4 months", 171 + ["years", 1, 4], 172 + ], 173 + [ 174 + date256407, date250303, "negative 61 years, 4 months", 175 + ["years", 61, 4], 176 + ], 177 + [ 178 + date256407, date256212, "negative 1 year, 7 months", 179 + ["years", 1, 7], 180 + ], 181 + [ 182 + date256407, date256312, "negative 7 months", 183 + ["years", 0, 7], 184 + ], 185 + [ 186 + date256407, date254012, "negative 23 years, 7 months", 187 + ["years", 23, 7], 188 + ], 189 + [ 190 + date256207, date251207, "crossing epoch", 191 + ["years", 50, 0], 192 + ], 193 + ]; 194 + 195 + for (const [one, two, descr, ...units] of tests) { 196 + for (const [largestUnit, years, months] of units) { 197 + TemporalHelpers.assertDuration( 198 + one.since(two, { largestUnit }), 199 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 200 + descr 201 + ); 202 + } 203 + }
+214
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-chinese.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (chinese calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "chinese"; 14 + 15 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 16 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 17 + const date196103 = Temporal.PlainYearMonth.from({ year: 1961, monthCode: "M03", calendar }); 18 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 19 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 20 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 21 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 22 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 23 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 24 + const date202102 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M02", calendar }); 25 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar }); 26 + const date202104 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M04", calendar }); 27 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 28 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 29 + const date202109 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M09", calendar }); 30 + const date202112 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M12", calendar }); 31 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 32 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 33 + const date202307 = Temporal.PlainYearMonth.from({ year: 2023, monthCode: "M07", calendar }); 34 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 35 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 36 + 37 + const tests = [ 38 + [ 39 + date202107, date202107, "same day", 40 + ["years", 0, 0], 41 + ["months", 0, 0], 42 + ], 43 + [ 44 + date202107, date202108, "1 month in same year (30-day month to 29-day month)", 45 + ["years", 0, -1], 46 + ["months", 0, -1], 47 + ], 48 + [ 49 + date202012, date202101, "1 month in different year", 50 + ["years", 0, -1], 51 + ["months", 0, -1], 52 + ], 53 + [ 54 + date202101, date202102, "1 month in same year (29-day month to 30-day month)", 55 + ["years", 0, -1], 56 + ["months", 0, -1], 57 + ], 58 + [ 59 + date202102, date202103, "1 month in a month with 30 days", 60 + ["years", 0, -1], 61 + ["months", 0, -1], 62 + ], 63 + [ 64 + date202107, date202109, "2 months which both have 30 days", 65 + ["years", 0, -2], 66 + ["months", 0, -2], 67 + ], 68 + [ 69 + date202107, date202207, "1 year", 70 + ["years", -1, 0], 71 + ["months", 0, -12], 72 + ], 73 + [ 74 + date202107, date203107, "10 years", 75 + ["years", -10, 0], 76 + ["months", 0, -124], 77 + ], 78 + [ 79 + date202107, date202209, "1 year 2 months", 80 + ["years", -1, -2], 81 + ], 82 + [ 83 + date202107, date203112, "10 years and 5 months", 84 + ["years", -10, -5], 85 + ], 86 + [ 87 + date199712, date202107, "23 years and 7 months", 88 + ["years", -23, -7], 89 + ], 90 + [ 91 + date199707, date202107, "24 years", 92 + ["years", -24, 0], 93 + ], 94 + [ 95 + date196002, date202003, "60 years, 1 month", 96 + ["years", -60, -1], 97 + ], 98 + [ 99 + date202103, date202107, "4 months", 100 + ["years", 0, -4], 101 + ], 102 + [ 103 + date202003, date202107, "1 year, 4 months", 104 + ["years", -1, -4], 105 + ], 106 + [ 107 + date196003, date202107, "61 years, 4 months", 108 + ["years", -61, -4], 109 + ], 110 + [ 111 + date201912, date202107, "1 year, 7 months", 112 + ["years", -1, -7], 113 + ], 114 + [ 115 + date202012, date202107, "7 months", 116 + ["years", 0, -7], 117 + ], 118 + [ 119 + date199712, date202107, "23 years, 7 months", 120 + ["years", -23, -7], 121 + ], 122 + [ 123 + date201912, date202103, "1 year, 3 months", 124 + ["years", -1, -3], 125 + ], 126 + [ 127 + date202108, date202107, "negative 1 month in same year", 128 + ["years", 0, 1], 129 + ["months", 0, 1], 130 + ], 131 + [ 132 + date202101, date202012, "negative 1 month in different year", 133 + ["years", 0, 1], 134 + ["months", 0, 1], 135 + ], 136 + [ 137 + date202103, date202102, "negative 1 month in a month with 30 days", 138 + ["years", 0, 1], 139 + ["months", 0, 1], 140 + ], 141 + [ 142 + date202104, date202102, "negative 2 months which both have 30 days", 143 + ["years", 0, 2], 144 + ["months", 0, 2], 145 + ], 146 + [ 147 + date202207, date202107, "negative 1 year", 148 + ["years", 1, 0], 149 + ["months", 0, 12], 150 + ], 151 + [ 152 + date203107, date202107, "negative 10 years", 153 + ["years", 10, 0], 154 + ["months", 0, 124], 155 + ], 156 + [ 157 + date202209, date202107, "negative 1 year 2 months", 158 + ["years", 1, 2], 159 + ], 160 + [ 161 + date203112, date202107, "negative 10 years and 5 months", 162 + ["years", 10, 5], 163 + ], 164 + [ 165 + date202107, date199712, "negative 23 years and 8 months", 166 + ["years", 23, 8], 167 + ], 168 + [ 169 + date202107, date199707, "negative 24 years", 170 + ["years", 24, 0], 171 + ], 172 + [ 173 + date202003, date196002, "negative 60 years, 1 month", 174 + ["years", 60, 1], 175 + ], 176 + [ 177 + date202107, date202103, "negative 4 months", 178 + ["years", 0, 4], 179 + ], 180 + [ 181 + date202207, date202103, "negative 1 year, 4 months", 182 + ["years", 1, 4], 183 + ], 184 + [ 185 + date202207, date196103, "negative 61 years, 4 months", 186 + ["years", 61, 4], 187 + ], 188 + [ 189 + date202307, date202112, "negative 1 year, 7 months", 190 + ["years", 1, 7], 191 + ], 192 + [ 193 + date202107, date202012, "negative 7 months", 194 + ["years", 0, 7], 195 + ], 196 + [ 197 + date202107, date199712, "negative 23 years, 8 months", 198 + ["years", 23, 8], 199 + ], 200 + [ 201 + date202103, date201912, "negative 1 year, 3 months", 202 + ["years", 1, 3], 203 + ] 204 + ]; 205 + 206 + for (const [one, two, descr, ...units] of tests) { 207 + for (const [largestUnit, years, months] of units) { 208 + TemporalHelpers.assertDuration( 209 + one.since(two, { largestUnit }), 210 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 211 + `${descr} (largestUnit = ${largestUnit})` 212 + ); 213 + } 214 + }
+219
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-coptic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (coptic calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "coptic"; 14 + 15 + // Years 16 + 17 + const date171002 = Temporal.PlainYearMonth.from({ year: 1710, monthCode: "M02", calendar }); 18 + const date171003 = Temporal.PlainYearMonth.from({ year: 1710, monthCode: "M03", calendar }); 19 + const date171103 = Temporal.PlainYearMonth.from({ year: 1711, monthCode: "M03", calendar }); 20 + const date171312 = Temporal.PlainYearMonth.from({ year: 1713, monthCode: "M12", calendar }); 21 + const date171612 = Temporal.PlainYearMonth.from({ year: 1716, monthCode: "M12", calendar }); 22 + const date171705 = Temporal.PlainYearMonth.from({ year: 1717, monthCode: "M05", calendar }); 23 + const date174707 = Temporal.PlainYearMonth.from({ year: 1747, monthCode: "M07", calendar }); 24 + const date174712 = Temporal.PlainYearMonth.from({ year: 1747, monthCode: "M12", calendar }); 25 + const date174713 = Temporal.PlainYearMonth.from({ year: 1747, monthCode: "M13", calendar }); 26 + const date176912 = Temporal.PlainYearMonth.from({ year: 1769, monthCode: "M12", calendar }); 27 + const date176913 = Temporal.PlainYearMonth.from({ year: 1769, monthCode: "M13", calendar }); 28 + const date177003 = Temporal.PlainYearMonth.from({ year: 1770, monthCode: "M03", calendar }); 29 + const date177012 = Temporal.PlainYearMonth.from({ year: 1770, monthCode: "M12", calendar }); 30 + const date177013 = Temporal.PlainYearMonth.from({ year: 1770, monthCode: "M13", calendar }); 31 + const date177101 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M01", calendar }); 32 + const date177102 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M02", calendar }); 33 + const date177103 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M03", calendar }); 34 + const date177104 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M04", calendar }); 35 + const date177106 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M06", calendar }); 36 + const date177107 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M07", calendar }); 37 + const date177108 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M08", calendar }); 38 + const date177112 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M12", calendar }); 39 + const date177207 = Temporal.PlainYearMonth.from({ year: 1772, monthCode: "M07", calendar }); 40 + const date177209 = Temporal.PlainYearMonth.from({ year: 1772, monthCode: "M09", calendar }); 41 + const date177307 = Temporal.PlainYearMonth.from({ year: 1773, monthCode: "M07", calendar }); 42 + const date178107 = Temporal.PlainYearMonth.from({ year: 1781, monthCode: "M07", calendar }); 43 + const date178112 = Temporal.PlainYearMonth.from({ year: 1781, monthCode: "M12", calendar }); 44 + 45 + const tests = [ 46 + [ 47 + date177107, date177107, "same day", 48 + ["years", 0, 0], 49 + ["months", 0, 0], 50 + ], 51 + [ 52 + date177107, date177108, "1 month in same year (30-day month to 29-day month)", 53 + ["years", 0, -1], 54 + ["months", 0, -1], 55 + ], 56 + [ 57 + date177013, date177101, "1 month in different year", 58 + ["years", 0, -1], 59 + ["months", 0, -1], 60 + ], 61 + [ 62 + date177101, date177102, "1 month in same year (29-day month to 30-day month)", 63 + ["years", 0, -1], 64 + ["months", 0, -1], 65 + ], 66 + [ 67 + date171612, date171705, "6 months in different year", 68 + ["months", 0, -6], 69 + ], 70 + [ 71 + date177207, date177307, "1 year", 72 + ["years", -1, 0], 73 + ["months", 0, -13], 74 + ], 75 + [ 76 + date177107, date178107, "10 years", 77 + ["years", -10, 0], 78 + ["months", 0, -130], 79 + ], 80 + [ 81 + date177107, date177209, "1 year 2 months", 82 + ["years", -1, -2], 83 + ], 84 + [ 85 + date171312, date171705, "3 years, 6 months", 86 + ["years", -3, -6], 87 + ], 88 + [ 89 + date177107, date178112, "10 years and 5 months", 90 + ["years", -10, -5], 91 + ], 92 + [ 93 + date174712, date177106, "23 years and 7 months", 94 + ["years", -23, -7], 95 + ], 96 + [ 97 + date174707, date177107, "24 years", 98 + ["years", -24, 0], 99 + ], 100 + [ 101 + date174707, date177106, "23 years, 12 months", 102 + ["years", -23, -12], 103 + ], 104 + [ 105 + date171002, date177003, "60 years, 1 month", 106 + ["years", -60, -1], 107 + ], 108 + [ 109 + date177103, date177107, "4 months", 110 + ["years", 0, -4], 111 + ], 112 + [ 113 + date177003, date177107, "1 year, 4 months", 114 + ["years", -1, -4], 115 + ], 116 + [ 117 + date171003, date177107, "61 years, 4 months", 118 + ["years", -61, -4], 119 + ], 120 + [ 121 + date176912, date177107, "1 year, 8 months", 122 + ["years", -1, -8], 123 + ], 124 + [ 125 + date177013, date177106, "6 months", 126 + ["years", 0, -6], 127 + ], 128 + [ 129 + date174713, date177106, "23 years, 6 months", 130 + ["years", -23, -6], 131 + ], 132 + [ 133 + date176913, date177102, "1 year, 2 months", 134 + ["years", -1, -2], 135 + ], 136 + [ 137 + date177108, date177107, "negative 1 month in same year", 138 + ["years", 0, 1], 139 + ["months", 0, 1], 140 + ], 141 + [ 142 + date177101, date177013, "negative 1 month in different year", 143 + ["years", 0, 1], 144 + ["months", 0, 1], 145 + ], 146 + [ 147 + date177104, date177102, "negative 2 months which both have 30 days", 148 + ["years", 0, 2], 149 + ["months", 0, 2], 150 + ], 151 + [ 152 + date177307, date177207, "negative 1 year", 153 + ["years", 1, 0], 154 + ["months", 0, 13], 155 + ], 156 + [ 157 + date178107, date177107, "negative 10 years", 158 + ["years", 10, 0], 159 + ["months", 0, 130], 160 + ], 161 + [ 162 + date177209, date177107, "negative 1 year 2 months", 163 + ["years", 1, 2], 164 + ], 165 + [ 166 + date178112, date177107, "negative 10 years and 5 months", 167 + ["years", 10, 5], 168 + ], 169 + [ 170 + date177107, date174712, "negative 23 years and 8 months", 171 + ["years", 23, 8], 172 + ], 173 + [ 174 + date177107, date174707, "negative 24 years", 175 + ["years", 24, 0], 176 + ], 177 + [ 178 + date177003, date171002, "negative 60 years, 1 month", 179 + ["years", 60, 1], 180 + ], 181 + [ 182 + date177107, date177103, "negative 4 months", 183 + ["years", 0, 4], 184 + ], 185 + [ 186 + date177207, date177103, "negative 1 year, 4 months", 187 + ["years", 1, 4], 188 + ], 189 + [ 190 + date177207, date171103, "negative 61 years, 4 months", 191 + ["years", 61, 4], 192 + ], 193 + [ 194 + date177307, date177112, "negative 1 year, 8 months", 195 + ["years", 1, 8], 196 + ], 197 + [ 198 + date177107, date177012, "negative 8 months", 199 + ["years", 0, 8], 200 + ], 201 + [ 202 + date177107, date174712, "negative 23 years, 8 months", 203 + ["years", 23, 8], 204 + ], 205 + [ 206 + date177103, date176912, "negative 1 year, 4 months", 207 + ["years", 1, 4], 208 + ] 209 + ]; 210 + 211 + for (const [one, two, descr, ...units] of tests) { 212 + for (const [largestUnit, years, months] of units) { 213 + TemporalHelpers.assertDuration( 214 + one.since(two, { largestUnit }), 215 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 216 + `${descr} (largestUnit = ${largestUnit})` 217 + ); 218 + } 219 + }
+197
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-dangi.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (dangi calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "dangi"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196103 = Temporal.PlainYearMonth.from({ year: 1961, monthCode: "M03", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 23 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 24 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 25 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 26 + const date202102 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M02", calendar }); 27 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar }); 28 + const date202104 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M04", calendar }); 29 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 30 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 31 + const date202109 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M09", calendar }); 32 + const date202112 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M12", calendar }); 33 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 34 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 35 + const date202307 = Temporal.PlainYearMonth.from({ year: 2023, monthCode: "M07", calendar }); 36 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 37 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 38 + 39 + const tests = [ 40 + [ 41 + date202107, date202107, "same day", 42 + ["years", 0, 0], 43 + ["months", 0, 0], 44 + ], 45 + [ 46 + date202107, date202108, "1 month in same year (30-day month to 29-day month)", 47 + ["years", 0, -1], 48 + ["months", 0, -1], 49 + ], 50 + [ 51 + date202012, date202101, "1 month in different year", 52 + ["years", 0, -1], 53 + ["months", 0, -1], 54 + ], 55 + [ 56 + date202101, date202102, "1 month in same year (29-day month to 30-day month)", 57 + ["years", 0, -1], 58 + ["months", 0, -1], 59 + ], 60 + [ 61 + date202107, date202109, "2 months which both have 30 days", 62 + ["years", 0, -2], 63 + ["months", 0, -2], 64 + ], 65 + [ 66 + date202107, date203107, "10 years", 67 + ["years", -10, 0], 68 + ["months", 0, -124], 69 + ], 70 + [ 71 + date202107, date202209, "1 year 2 months", 72 + ["years", -1, -2], 73 + ], 74 + [ 75 + date202107, date203112, "10 years and 5 months", 76 + ["years", -10, -5], 77 + ], 78 + [ 79 + date199712, date202107, "23 years and 7 months", 80 + ["years", -23, -7], 81 + ], 82 + [ 83 + date199707, date202107, "24 years", 84 + ["years", -24, 0], 85 + ], 86 + [ 87 + date196002, date202003, "60 years, 1 month", 88 + ["years", -60, -1], 89 + ], 90 + [ 91 + date202103, date202107, "4 months", 92 + ["years", 0, -4], 93 + ], 94 + [ 95 + date202003, date202107, "1 year, 4 months", 96 + ["years", -1, -4], 97 + ], 98 + [ 99 + date196003, date202107, "61 years, 4 months", 100 + ["years", -61, -4], 101 + ], 102 + [ 103 + date201912, date202107, "1 year, 7 months", 104 + ["years", -1, -7], 105 + ], 106 + [ 107 + date202012, date202107, "7 months", 108 + ["years", 0, -7], 109 + ], 110 + [ 111 + date199712, date202107, "23 years, 7 months", 112 + ["years", -23, -7], 113 + ], 114 + [ 115 + date202108, date202107, "negative 1 month in same year", 116 + ["years", 0, 1], 117 + ["months", 0, 1], 118 + ], 119 + [ 120 + date202101, date202012, "negative 1 month in different year", 121 + ["years", 0, 1], 122 + ["months", 0, 1], 123 + ], 124 + [ 125 + date202104, date202102, "negative 2 months which both have 30 days", 126 + ["years", 0, 2], 127 + ["months", 0, 2], 128 + ], 129 + [ 130 + date202207, date202107, "negative 1 year", 131 + ["years", 1, 0], 132 + ["months", 0, 12], 133 + ], 134 + [ 135 + date203107, date202107, "negative 10 years", 136 + ["years", 10, 0], 137 + ["months", 0, 124], 138 + ], 139 + [ 140 + date202209, date202107, "negative 1 year 2 months", 141 + ["years", 1, 2], 142 + ], 143 + [ 144 + date203112, date202107, "negative 10 years and 5 months", 145 + ["years", 10, 5], 146 + ], 147 + [ 148 + date202107, date199712, "negative 23 years and 8 months", 149 + ["years", 23, 8], 150 + ], 151 + [ 152 + date202107, date199707, "negative 24 years", 153 + ["years", 24, 0], 154 + ], 155 + [ 156 + date202003, date196002, "negative 60 years, 1 month", 157 + ["years", 60, 1], 158 + ], 159 + [ 160 + date202107, date202103, "negative 4 months", 161 + ["years", 0, 4], 162 + ], 163 + [ 164 + date202207, date202103, "negative 1 year, 4 months", 165 + ["years", 1, 4], 166 + ], 167 + [ 168 + date202207, date196103, "negative 61 years, 4 months", 169 + ["years", 61, 4], 170 + ], 171 + [ 172 + date202307, date202112, "negative 1 year, 7 months", 173 + ["years", 1, 7], 174 + ], 175 + [ 176 + date202107, date202012, "negative 7 months", 177 + ["years", 0, 7], 178 + ], 179 + [ 180 + date202107, date199712, "negative 23 years, 8 months", 181 + ["years", 23, 8], 182 + ], 183 + [ 184 + date202103, date201912, "negative 1 year, 3 months", 185 + ["years", 1, 3], 186 + ] 187 + ]; 188 + 189 + for (const [one, two, descr, ...units] of tests) { 190 + for (const [largestUnit, years, months] of units) { 191 + TemporalHelpers.assertDuration( 192 + one.since(two, { largestUnit }), 193 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 194 + `${descr} (largestUnit = ${largestUnit})` 195 + ); 196 + } 197 + }
+213
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-ethioaa.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (ethioaa calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "ethioaa"; 14 + 15 + // Years 16 + 17 + const date745302 = Temporal.PlainYearMonth.from({ year: 7453, monthCode: "M02", calendar }); 18 + const date745303 = Temporal.PlainYearMonth.from({ year: 7453, monthCode: "M03", calendar }); 19 + const date745403 = Temporal.PlainYearMonth.from({ year: 7454, monthCode: "M03", calendar }); 20 + const date748912 = Temporal.PlainYearMonth.from({ year: 7489, monthCode: "M12", calendar }); 21 + const date749007 = Temporal.PlainYearMonth.from({ year: 7490, monthCode: "M07", calendar }); 22 + const date749012 = Temporal.PlainYearMonth.from({ year: 7490, monthCode: "M12", calendar }); 23 + const date749013 = Temporal.PlainYearMonth.from({ year: 7490, monthCode: "M13", calendar }); 24 + const date749305 = Temporal.PlainYearMonth.from({ year: 7493, monthCode: "M05", calendar }); 25 + const date751212 = Temporal.PlainYearMonth.from({ year: 7512, monthCode: "M12", calendar }); 26 + const date751213 = Temporal.PlainYearMonth.from({ year: 7512, monthCode: "M13", calendar }); 27 + const date751303 = Temporal.PlainYearMonth.from({ year: 7513, monthCode: "M03", calendar }); 28 + const date751313 = Temporal.PlainYearMonth.from({ year: 7513, monthCode: "M13", calendar }); 29 + const date751401 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M01", calendar }); 30 + const date751402 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M02", calendar }); 31 + const date751403 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M03", calendar }); 32 + const date751404 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M04", calendar }); 33 + const date751406 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M06", calendar }); 34 + const date751407 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M07", calendar }); 35 + const date751408 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M08", calendar }); 36 + const date751412 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M12", calendar }); 37 + const date751507 = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M07", calendar }); 38 + const date751509 = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M09", calendar }); 39 + const date751607 = Temporal.PlainYearMonth.from({ year: 7516, monthCode: "M07", calendar }); 40 + const date752407 = Temporal.PlainYearMonth.from({ year: 7524, monthCode: "M07", calendar }); 41 + const date752412 = Temporal.PlainYearMonth.from({ year: 7524, monthCode: "M12", calendar }); 42 + 43 + const tests = [ 44 + [ 45 + date751407, date751407, "same day", 46 + ["years", 0, 0], 47 + ["months", 0, 0], 48 + ], 49 + [ 50 + date751407, date751408, "1 month in same year (30-day month to 29-day month)", 51 + ["years", 0, -1], 52 + ["months", 0, -1], 53 + ], 54 + [ 55 + date751313, date751401, "1 month in different year", 56 + ["years", 0, -1], 57 + ["months", 0, -1], 58 + ], 59 + [ 60 + date751401, date751402, "1 month in same year (29-day month to 30-day month)", 61 + ["years", 0, -1], 62 + ["months", 0, -1], 63 + ], 64 + [ 65 + date751407, date751507, "1 year", 66 + ["years", -1, 0], 67 + ["months", 0, -13], 68 + ], 69 + [ 70 + date751407, date752407, "10 years", 71 + ["years", -10, 0], 72 + ["months", 0, -130], 73 + ], 74 + [ 75 + date751407, date751509, "1 year 2 months", 76 + ["years", -1, -2], 77 + ], 78 + [ 79 + date751407, date752412, "10 years and 5 months", 80 + ["years", -10, -5], 81 + ], 82 + [ 83 + date749012, date751406, "23 years and 7 months", 84 + ["years", -23, -7], 85 + ], 86 + [ 87 + date749007, date751407, "24 years", 88 + ["years", -24, 0], 89 + ], 90 + [ 91 + date749007, date751406, "23 years, 12 months", 92 + ["years", -23, -12], 93 + ], 94 + [ 95 + date745302, date751303, "60 years, 1 month", 96 + ["years", -60, -1], 97 + ], 98 + [ 99 + date751403, date751407, "4 months", 100 + ["years", 0, -4], 101 + ], 102 + [ 103 + date751303, date751407, "1 year, 4 months", 104 + ["years", -1, -4], 105 + ], 106 + [ 107 + date748912, date749305, "3 years, 6 months", 108 + ["years", -3, -6], 109 + ], 110 + [ 111 + date745303, date751407, "61 years, 4 months", 112 + ["years", -61, -4], 113 + ], 114 + [ 115 + date751212, date751407, "1 year, 8 months", 116 + ["years", -1, -8], 117 + ], 118 + [ 119 + date751313, date751406, "6 months", 120 + ["years", 0, -6], 121 + ], 122 + [ 123 + date749013, date751406, "23 years, 6 months", 124 + ["years", -23, -6], 125 + ], 126 + [ 127 + date751213, date751402, "1 year, 2 months", 128 + ["years", -1, -2], 129 + ], 130 + [ 131 + date751408, date751407, "negative 1 month in same year", 132 + ["years", 0, 1], 133 + ["months", 0, 1], 134 + ], 135 + [ 136 + date751401, date751313, "negative 1 month in different year", 137 + ["years", 0, 1], 138 + ["months", 0, 1], 139 + ], 140 + [ 141 + date751404, date751402, "negative 2 months which both have 30 days", 142 + ["years", 0, 2], 143 + ["months", 0, 2], 144 + ], 145 + [ 146 + date751507, date751407, "negative 1 year", 147 + ["years", 1, 0], 148 + ["months", 0, 13], 149 + ], 150 + [ 151 + date752407, date751407, "negative 10 years", 152 + ["years", 10, 0], 153 + ["months", 0, 130], 154 + ], 155 + [ 156 + date751509, date751407, "negative 1 year 2 months", 157 + ["years", 1, 2], 158 + ], 159 + [ 160 + date752412, date751407, "negative 10 years and 5 months", 161 + ["years", 10, 5], 162 + ], 163 + [ 164 + date751407, date749012, "negative 23 years and 8 months", 165 + ["years", 23, 8], 166 + ], 167 + [ 168 + date751407, date749007, "negative 24 years", 169 + ["years", 24, 0], 170 + ], 171 + [ 172 + date751303, date745302, "negative 60 years, 1 month", 173 + ["years", 60, 1], 174 + ], 175 + [ 176 + date751407, date751403, "negative 4 months", 177 + ["years", 0, 4], 178 + ], 179 + [ 180 + date751507, date751403, "negative 1 year, 4 months", 181 + ["years", 1, 4], 182 + ], 183 + [ 184 + date751507, date745403, "negative 61 years, 4 months", 185 + ["years", 61, 4], 186 + ], 187 + [ 188 + date751607, date751412, "negative 1 year, 8 months", 189 + ["years", 1, 8], 190 + ], 191 + [ 192 + date751507, date751412, "negative 8 months", 193 + ["years", 0, 8], 194 + ], 195 + [ 196 + date751407, date749012, "negative 23 years, 8 months", 197 + ["years", 23, 8], 198 + ], 199 + [ 200 + date751403, date751212, "negative 1 year, 4 months", 201 + ["years", 1, 4], 202 + ] 203 + ]; 204 + 205 + for (const [one, two, descr, ...units] of tests) { 206 + for (const [largestUnit, years, months] of units) { 207 + TemporalHelpers.assertDuration( 208 + one.since(two, { largestUnit }), 209 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 210 + `${descr} (largestUnit = ${largestUnit})` 211 + ); 212 + } 213 + }
+209
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-ethiopic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (ethiopic calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "ethiopic"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196103 = Temporal.PlainYearMonth.from({ year: 1961, monthCode: "M03", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date199713 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M13", calendar }); 23 + const date200105 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M05", calendar }); 24 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 25 + const date201913 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M13", calendar }); 26 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 27 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 28 + const date202013 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M13", calendar }); 29 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 30 + const date202102 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M02", calendar }); 31 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar }); 32 + const date202104 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M04", calendar }); 33 + const date202106 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M06", calendar }); 34 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 35 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 36 + const date202112 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M12", calendar }); 37 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 38 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 39 + const date202307 = Temporal.PlainYearMonth.from({ year: 2023, monthCode: "M07", calendar }); 40 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 41 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 42 + 43 + const tests = [ 44 + [ 45 + date202107, date202107, "same day", 46 + ["years", 0, 0], 47 + ["months", 0, 0], 48 + ], 49 + [ 50 + date202107, date202108, "1 month in same year (30-day month to 29-day month)", 51 + ["years", 0, -1], 52 + ["months", 0, -1], 53 + ], 54 + [ 55 + date202013, date202101, "1 month in different year", 56 + ["years", 0, -1], 57 + ["months", 0, -1], 58 + ], 59 + [ 60 + date202101, date202102, "1 month in same year (29-day month to 30-day month)", 61 + ["years", 0, -1], 62 + ["months", 0, -1], 63 + ], 64 + [ 65 + date202207, date202307, "1 year", 66 + ["years", -1, 0], 67 + ["months", 0, -13], 68 + ], 69 + [ 70 + date202107, date203107, "10 years", 71 + ["years", -10, 0], 72 + ["months", 0, -130], 73 + ], 74 + [ 75 + date202107, date202209, "1 year 2 months", 76 + ["years", -1, -2], 77 + ], 78 + [ 79 + date202107, date203112, "10 years and 5 months", 80 + ["years", -10, -5], 81 + ], 82 + [ 83 + date199712, date202106, "23 years and 7 months", 84 + ["years", -23, -7], 85 + ], 86 + [ 87 + date199707, date202107, "24 years", 88 + ["years", -24, 0], 89 + ], 90 + [ 91 + date199707, date202106, "23 years, 12 months", 92 + ["years", -23, -12], 93 + ], 94 + [ 95 + date196002, date202003, "60 years, 1 month", 96 + ["years", -60, -1], 97 + ], 98 + [ 99 + date202103, date202107, "4 months", 100 + ["years", 0, -4], 101 + ], 102 + [ 103 + date202003, date202107, "1 year, 4 months", 104 + ["years", -1, -4], 105 + ], 106 + [ 107 + date199712, date200105, "3 years, 6 months", 108 + ["years", -3, -6], 109 + ], 110 + [ 111 + date196003, date202107, "61 years, 4 months", 112 + ["years", -61, -4], 113 + ], 114 + [ 115 + date201912, date202107, "1 year, 8 months", 116 + ["years", -1, -8], 117 + ], 118 + [ 119 + date202013, date202106, "6 months", 120 + ["years", 0, -6], 121 + ], 122 + [ 123 + date199713, date202106, "23 years, 6 months", 124 + ["years", -23, -6], 125 + ], 126 + [ 127 + date201913, date202102, "1 year, 2 months", 128 + ["years", -1, -2], 129 + ], 130 + [ 131 + date202108, date202107, "negative 1 month in same year", 132 + ["years", 0, 1], 133 + ["months", 0, 1], 134 + ], 135 + [ 136 + date202101, date202013, "negative 1 month in different year", 137 + ["years", 0, 1], 138 + ["months", 0, 1], 139 + ], 140 + [ 141 + date202104, date202102, "negative 2 months which both have 30 days", 142 + ["years", 0, 2], 143 + ["months", 0, 2], 144 + ], 145 + [ 146 + date202307, date202207, "negative 1 year", 147 + ["years", 1, 0], 148 + ["months", 0, 13], 149 + ], 150 + [ 151 + date203107, date202107, "negative 10 years", 152 + ["years", 10, 0], 153 + ["months", 0, 130], 154 + ], 155 + [ 156 + date202209, date202107, "negative 1 year 2 months", 157 + ["years", 1, 2], 158 + ], 159 + [ 160 + date203112, date202107, "negative 10 years and 5 months", 161 + ["years", 10, 5], 162 + ], 163 + [ 164 + date202107, date199712, "negative 23 years and 8 months", 165 + ["years", 23, 8], 166 + ], 167 + [ 168 + date202107, date199707, "negative 24 years", 169 + ["years", 24, 0], 170 + ], 171 + [ 172 + date202003, date196002, "negative 60 years, 1 month", 173 + ["years", 60, 1], 174 + ], 175 + [ 176 + date202107, date202103, "negative 4 months", 177 + ["years", 0, 4], 178 + ], 179 + [ 180 + date202207, date202103, "negative 1 year, 4 months", 181 + ["years", 1, 4], 182 + ], 183 + [ 184 + date202207, date196103, "negative 61 years, 4 months", 185 + ["years", 61, 4], 186 + ], 187 + [ 188 + date202307, date202112, "negative 1 year, 8 months", 189 + ["years", 1, 8], 190 + ], 191 + [ 192 + date202107, date202012, "negative 8 months", 193 + ["years", 0, 8], 194 + ], 195 + [ 196 + date202107, date199712, "negative 23 years, 8 months", 197 + ["years", 23, 8], 198 + ], 199 + ]; 200 + 201 + for (const [one, two, descr, ...units] of tests) { 202 + for (const [largestUnit, years, months] of units) { 203 + TemporalHelpers.assertDuration( 204 + one.since(two, { largestUnit }), 205 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 206 + `${descr} (largestUnit = ${largestUnit})` 207 + ); 208 + } 209 + }
+211
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-gregory.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (gregory calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "gregory"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196907 = Temporal.PlainYearMonth.from({ year: 1969, monthCode: "M07", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date200106 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M06", calendar }); 23 + const date201907 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M07", calendar }); 24 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 25 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 26 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 27 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 28 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar }); 29 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 30 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 31 + const date202109 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M09", calendar }); 32 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 33 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 34 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 35 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 36 + 37 + const tests = [ 38 + [ 39 + date202107, date202107, "same day", 40 + ["years", 0, 0], 41 + ["months", 0, 0], 42 + ], 43 + [ 44 + date202107, date202108, "1 month in same year", 45 + ["years", 0, -1], 46 + ["months", 0, -1], 47 + ], 48 + [ 49 + date202012, date202101, "1 month in different year", 50 + ["years", 0, -1], 51 + ["months", 0, -1], 52 + ], 53 + [ 54 + date202107, date202109, "2 months which both have 31 days", 55 + ["years", 0, -2], 56 + ["months", 0, -2], 57 + ], 58 + [ 59 + date202107, date202207, "1 year", 60 + ["years", -1, 0], 61 + ["months", 0, -12], 62 + ], 63 + [ 64 + date202107, date203107, "10 years", 65 + ["years", -10, 0], 66 + ["months", 0, -120], 67 + ], 68 + [ 69 + date202107, date202209, "1 year 2 months", 70 + ["years", -1, -2], 71 + ], 72 + [ 73 + date202107, date203112, "10 years and 5 months", 74 + ["years", -10, -5], 75 + ], 76 + [ 77 + date199712, date202107, "23 years and 7 months", 78 + ["years", -23, -7], 79 + ], 80 + [ 81 + date199707, date202107, "24 years", 82 + ["years", -24, 0], 83 + ], 84 + [ 85 + date196002, date202003, "60 years, 1 month", 86 + ["years", -60, -1], 87 + ], 88 + [ 89 + date202103, date202107, "4 months", 90 + ["years", 0, -4], 91 + ], 92 + [ 93 + date202003, date202107, "1 year, 4 months", 94 + ["years", -1, -4], 95 + ], 96 + [ 97 + date199712, date200106, "3 years, 6 months", 98 + ["years", -3, -6], 99 + ], 100 + [ 101 + date196003, date202107, "61 years, 4 months", 102 + ["years", -61, -4], 103 + ], 104 + [ 105 + date201912, date202107, "1 year, 7 months", 106 + ["years", -1, -7], 107 + ], 108 + [ 109 + date202012, date202107, "7 months", 110 + ["years", 0, -7], 111 + ], 112 + [ 113 + date199712, date202107, "23 years, 7 months", 114 + ["years", -23, -7], 115 + ], 116 + [ 117 + date201912, date202103, "1 year, 3 months", 118 + ["years", -1, -3], 119 + ], 120 + [ 121 + date196907, date201907, "crossing epoch", 122 + ["years", -50, 0], 123 + ], 124 + [ 125 + date202108, date202107, "negative 1 month in same year", 126 + ["years", 0, 1], 127 + ["months", 0, 1], 128 + ], 129 + [ 130 + date202101, date202012, "negative 1 month in different year", 131 + ["years", 0, 1], 132 + ["months", 0, 1], 133 + ], 134 + [ 135 + date202109, date202107, "negative 2 months which both have 31 days", 136 + ["years", 0, 2], 137 + ["months", 0, 2], 138 + ], 139 + [ 140 + date202207, date202107, "negative 1 year", 141 + ["years", 1, 0], 142 + ["months", 0, 12], 143 + ], 144 + [ 145 + date203107, date202107, "negative 10 years", 146 + ["years", 10, 0], 147 + ["months", 0, 120], 148 + ], 149 + [ 150 + date202209, date202107, "negative 1 year 2 months", 151 + ["years", 1, 2], 152 + ], 153 + [ 154 + date203112, date202107, "negative 10 years and 5 months", 155 + ["years", 10, 5], 156 + ], 157 + [ 158 + date202107, date199712, "negative 23 years and 7 months", 159 + ["years", 23, 7], 160 + ], 161 + [ 162 + date202107, date199707, "negative 24 years", 163 + ["years", 24, 0], 164 + ], 165 + [ 166 + date202003, date196002, "negative 60 years, 1 month", 167 + ["years", 60, 1], 168 + ], 169 + [ 170 + date202107, date202103, "negative 4 months", 171 + ["years", 0, 4], 172 + ], 173 + [ 174 + date202107, date202003, "negative 1 year, 4 months", 175 + ["years", 1, 4], 176 + ], 177 + [ 178 + date202107, date196003, "negative 61 years, 4 months", 179 + ["years", 61, 4], 180 + ], 181 + [ 182 + date202107, date201912, "negative 1 year, 7 months", 183 + ["years", 1, 7], 184 + ], 185 + [ 186 + date202107, date202012, "negative 7 months", 187 + ["years", 0, 7], 188 + ], 189 + [ 190 + date202107, date199712, "negative 23 years, 7 months", 191 + ["years", 23, 7], 192 + ], 193 + [ 194 + date202103, date201912, "negative 1 year, 3 months", 195 + ["years", 1, 3], 196 + ], 197 + [ 198 + date201907, date196907, "crossing epoch", 199 + ["years", 50, 0], 200 + ], 201 + ]; 202 + 203 + for (const [one, two, descr, ...units] of tests) { 204 + for (const [largestUnit, years, months] of units) { 205 + TemporalHelpers.assertDuration( 206 + one.since(two, { largestUnit }), 207 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 208 + descr 209 + ); 210 + } 211 + }
+211
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-hebrew.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (hebrew calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "hebrew"; 14 + 15 + // Years 16 + 17 + const date572202 = Temporal.PlainYearMonth.from({ year: 5722, monthCode: "M02", calendar }); 18 + const date572203 = Temporal.PlainYearMonth.from({ year: 5722, monthCode: "M03", calendar }); 19 + const date572302 = Temporal.PlainYearMonth.from({ year: 5723, monthCode: "M02", calendar }); 20 + const date572303 = Temporal.PlainYearMonth.from({ year: 5723, monthCode: "M03", calendar }); 21 + const date575901 = Temporal.PlainYearMonth.from({ year: 5759, monthCode: "M01", calendar }); 22 + const date575910 = Temporal.PlainYearMonth.from({ year: 5759, monthCode: "M10", calendar }); 23 + const date575912 = Temporal.PlainYearMonth.from({ year: 5759, monthCode: "M12", calendar }); 24 + const date576001 = Temporal.PlainYearMonth.from({ year: 5760, monthCode: "M01", calendar }); 25 + const date576007 = Temporal.PlainYearMonth.from({ year: 5760, monthCode: "M07", calendar }); 26 + const date576012 = Temporal.PlainYearMonth.from({ year: 5760, monthCode: "M12", calendar }); 27 + const date576206 = Temporal.PlainYearMonth.from({ year: 5762, monthCode: "M06", calendar }); 28 + const date578112 = Temporal.PlainYearMonth.from({ year: 5781, monthCode: "M12", calendar }); 29 + const date578203 = Temporal.PlainYearMonth.from({ year: 5782, monthCode: "M03", calendar }); 30 + const date578207 = Temporal.PlainYearMonth.from({ year: 5782, monthCode: "M07", calendar }); 31 + const date578212 = Temporal.PlainYearMonth.from({ year: 5782, monthCode: "M12", calendar }); 32 + const date578301 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M01", calendar }); 33 + const date578303 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M03", calendar }); 34 + const date578307 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M07", calendar }); 35 + const date578308 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M08", calendar }); 36 + const date578309 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M09", calendar }); 37 + const date578407 = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M07", calendar }); 38 + const date578409 = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M09", calendar }); 39 + const date579307 = Temporal.PlainYearMonth.from({ year: 5793, monthCode: "M07", calendar }); 40 + const date579312 = Temporal.PlainYearMonth.from({ year: 5793, monthCode: "M12", calendar }); 41 + 42 + const tests = [ 43 + [ 44 + date578307, date578307, "same day", 45 + ["years", 0, 0], 46 + ["months", 0, 0], 47 + ], 48 + [ 49 + date578307, date578308, "1 month in same year", 50 + ["years", 0, -1], 51 + ["months", 0, -1], 52 + ], 53 + [ 54 + date578212, date578301, "1 month in different year", 55 + ["years", 0, -1], 56 + ["months", 0, -1], 57 + ], 58 + [ 59 + date578307, date578309, "2 months which both have 30 days", 60 + ["years", 0, -2], 61 + ["months", 0, -2], 62 + ], 63 + [ 64 + date578207, date578307, "1 year", 65 + ["years", -1, 0], 66 + ["months", 0, -12], 67 + ], 68 + [ 69 + date578307, date579307, "10 years", 70 + ["years", -10, 0], 71 + ["months", 0, -124], 72 + ], 73 + [ 74 + date578307, date578409, "1 year 2 months", 75 + ["years", -1, -2], 76 + ], 77 + [ 78 + date575912, date576206, "2 years 6 months", 79 + ["years", -2, -6], 80 + ], 81 + [ 82 + date578307, date579312, "10 years and 5 months", 83 + ["years", -10, -5], 84 + ], 85 + [ 86 + date576012, date578407, "23 years and 8 months", 87 + ["years", -23, -8], 88 + ], 89 + [ 90 + date576007, date578407, "24 years", 91 + ["years", -24, 0], 92 + ], 93 + [ 94 + date572302, date578303, "60 years, 1 month", 95 + ["years", -60, -1], 96 + ], 97 + [ 98 + date578303, date578307, "4 months", 99 + ["years", 0, -4], 100 + ], 101 + [ 102 + date578203, date578307, "1 year, 4 months", 103 + ["years", -1, -4], 104 + ], 105 + [ 106 + date572303, date578407, "61 years, 5 months", 107 + ["years", -61, -5], 108 + ], 109 + [ 110 + date578112, date578307, "1 year, 7 months", 111 + ["years", -1, -7], 112 + ], 113 + [ 114 + date578212, date578307, "7 months", 115 + ["years", 0, -7], 116 + ], 117 + [ 118 + date575901, date575910, "40 weeks", 119 + ], 120 + [ 121 + date576001, date578307, "23 years, 6 months", 122 + ["years", -23, -6], 123 + ], 124 + [ 125 + date578112, date578303, "1 year, 3 months", 126 + ["years", -1, -3], 127 + ], 128 + [ 129 + date578308, date578307, "negative 1 month in same year", 130 + ["years", 0, 1], 131 + ["months", 0, 1], 132 + ], 133 + [ 134 + date578301, date578212, "negative 1 month in different year", 135 + ["years", 0, 1], 136 + ["months", 0, 1], 137 + ], 138 + [ 139 + date578309, date578307, "negative 2 months which both have 30 days", 140 + ["years", 0, 2], 141 + ["months", 0, 2], 142 + ], 143 + [ 144 + date578307, date578207, "negative 1 year", 145 + ["years", 1, 0], 146 + ["months", 0, 12], 147 + ], 148 + [ 149 + date579307, date578307, "negative 10 years", 150 + ["years", 10, 0], 151 + ["months", 0, 124], 152 + ], 153 + [ 154 + date578409, date578307, "negative 1 year 2 months", 155 + ["years", 1, 2], 156 + ], 157 + [ 158 + date579312, date578307, "negative 10 years and 5 months", 159 + ["years", 10, 5], 160 + ], 161 + [ 162 + date578407, date576012, "negative 23 years and 7 months", 163 + ["years", 23, 7], 164 + ], 165 + [ 166 + date578407, date576007, "negative 24 years", 167 + ["years", 24, 0], 168 + ], 169 + [ 170 + date578203, date572202, "negative 60 years, 1 month", 171 + ["years", 60, 1], 172 + ], 173 + [ 174 + date578307, date578303, "negative 4 months", 175 + ["years", 0, 4], 176 + ], 177 + [ 178 + date578307, date578203, "negative 1 year, 5 months", 179 + ["years", 1, 5], 180 + ], 181 + [ 182 + date578307, date572203, "negative 61 years, 5 months", 183 + ["years", 61, 5], 184 + ], 185 + [ 186 + date578307, date578112, "negative 1 year, 8 months", 187 + ["years", 1, 8], 188 + ], 189 + [ 190 + date578307, date578212, "negative 7 months", 191 + ["years", 0, 7], 192 + ], 193 + [ 194 + date578307, date575912, "negative 23 years, 8 months", 195 + ["years", 23, 8], 196 + ], 197 + [ 198 + date578303, date578112, "negative 1 year, 3 months", 199 + ["years", 1, 3], 200 + ] 201 + ]; 202 + 203 + for (const [one, two, descr, ...units] of tests) { 204 + for (const [largestUnit, years, months] of units) { 205 + TemporalHelpers.assertDuration( 206 + one.since(two, { largestUnit }), 207 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 208 + descr 209 + ); 210 + } 211 + }
+205
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-indian.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (indian calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "indian"; 14 + 15 + // Years 16 + 17 + const date188102 = Temporal.PlainYearMonth.from({ year: 1881, monthCode: "M02", calendar }); 18 + const date188202 = Temporal.PlainYearMonth.from({ year: 1882, monthCode: "M02", calendar }); 19 + const date188203 = Temporal.PlainYearMonth.from({ year: 1882, monthCode: "M03", calendar }); 20 + const date191907 = Temporal.PlainYearMonth.from({ year: 1919, monthCode: "M07", calendar }); 21 + const date191912 = Temporal.PlainYearMonth.from({ year: 1919, monthCode: "M12", calendar }); 22 + const date192306 = Temporal.PlainYearMonth.from({ year: 1923, monthCode: "M06", calendar }); 23 + const date194103 = Temporal.PlainYearMonth.from({ year: 1941, monthCode: "M03", calendar }); 24 + const date194112 = Temporal.PlainYearMonth.from({ year: 1941, monthCode: "M12", calendar }); 25 + const date194203 = Temporal.PlainYearMonth.from({ year: 1942, monthCode: "M03", calendar }); 26 + const date194212 = Temporal.PlainYearMonth.from({ year: 1942, monthCode: "M12", calendar }); 27 + const date194301 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M01", calendar }); 28 + const date194302 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M02", calendar }); 29 + const date194303 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M03", calendar });; 30 + const date194304 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M04", calendar }); 31 + const date194306 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M06", calendar }); 32 + const date194307 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M07", calendar }); 33 + const date194308 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M08", calendar }); 34 + const date194407 = Temporal.PlainYearMonth.from({ year: 1944, monthCode: "M07", calendar }); 35 + const date194409 = Temporal.PlainYearMonth.from({ year: 1944, monthCode: "M09", calendar }); 36 + const date195307 = Temporal.PlainYearMonth.from({ year: 1953, monthCode: "M07", calendar }); 37 + const date195312 = Temporal.PlainYearMonth.from({ year: 1953, monthCode: "M12", calendar }); 38 + 39 + const tests = [ 40 + [ 41 + date194307, date194307, "same day", 42 + ["years", 0, 0], 43 + ["months", 0, 0], 44 + ], 45 + [ 46 + date194307, date194308, "1 month in same year", 47 + ["years", 0, -1], 48 + ["months", 0, -1], 49 + ], 50 + [ 51 + date194212, date194301, "1 month in different year", 52 + ["years", 0, -1], 53 + ["months", 0, -1], 54 + ], 55 + [ 56 + date194302, date194304, "2 months which both have 31 days", 57 + ["years", 0, -2], 58 + ["months", 0, -2], 59 + ], 60 + [ 61 + date194307, date194407, "1 year", 62 + ["years", -1, 0], 63 + ["months", 0, -12], 64 + ], 65 + [ 66 + date194307, date195307, "10 years", 67 + ["years", -10, 0], 68 + ["months", 0, -120], 69 + ], 70 + [ 71 + date194307, date194409, "1 year 2 months", 72 + ["years", -1, -2], 73 + ], 74 + [ 75 + date194307, date195312, "10 years and 5 months", 76 + ["years", -10, -5], 77 + ], 78 + [ 79 + date191912, date194307, "23 years and 7 months", 80 + ["years", -23, -7], 81 + ], 82 + [ 83 + date191907, date194307, "24 years", 84 + ["years", -24, 0], 85 + ], 86 + [ 87 + date188202, date194203, "60 years, 1 month", 88 + ["years", -60, -1], 89 + ], 90 + [ 91 + date194303, date194307, "4 months", 92 + ["years", 0, -4], 93 + ], 94 + [ 95 + date194203, date194307, "1 year, 4 months", 96 + ["years", -1, -4], 97 + ], 98 + [ 99 + date191912, date192306, "3 years, 6 months", 100 + ["years", -3, -6], 101 + ], 102 + [ 103 + date188203, date194307, "61 years, 4 months", 104 + ["years", -61, -4], 105 + ], 106 + [ 107 + date194112, date194307, "1 year, 7 months", 108 + ["years", -1, -7], 109 + ], 110 + [ 111 + date194212, date194307, "7 months", 112 + ["years", 0, -7], 113 + ], 114 + [ 115 + date191912, date194307, "23 years, 7 months", 116 + ["years", -23, -7], 117 + ], 118 + [ 119 + date194112, date194303, "1 year, 3 months", 120 + ["years", -1, -3], 121 + ], 122 + [ 123 + date194308, date194307, "negative 1 month in same year", 124 + ["years", 0, 1], 125 + ["months", 0, 1], 126 + ], 127 + [ 128 + date194301, date194212, "negative 1 month in different year", 129 + ["years", 0, 1], 130 + ["months", 0, 1], 131 + ], 132 + [ 133 + date194306, date194304, "negative 2 months which both have 31 days", 134 + ["years", 0, 2], 135 + ["months", 0, 2], 136 + ], 137 + [ 138 + date194407, date194307, "negative 1 year", 139 + ["years", 1, 0], 140 + ["months", 0, 12], 141 + ], 142 + [ 143 + date195307, date194307, "negative 10 years", 144 + ["years", 10, 0], 145 + ["months", 0, 120], 146 + ], 147 + [ 148 + date194409, date194307, "negative 1 year 2 months", 149 + ["years", 1, 2], 150 + ], 151 + [ 152 + date195312, date194307, "negative 10 years and 5 months", 153 + ["years", 10, 5], 154 + ], 155 + [ 156 + date194307, date191912, "negative 23 years and 7 months", 157 + ["years", 23, 7], 158 + ], 159 + [ 160 + date194307, date191907, "negative 24 years", 161 + ["years", 24, 0], 162 + ], 163 + [ 164 + date194103, date188102, "negative 60 years, 1 month", 165 + ["years", 60, 1], 166 + ], 167 + [ 168 + date194307, date194303, "negative 4 months", 169 + ["years", 0, 4], 170 + ], 171 + [ 172 + date194307, date194203, "negative 1 year, 4 months", 173 + ["years", 1, 4], 174 + ], 175 + [ 176 + date194307, date188203, "negative 61 years, 4 months", 177 + ["years", 61, 4], 178 + ], 179 + [ 180 + date194307, date194112, "negative 1 year, 7 months", 181 + ["years", 1, 7], 182 + ], 183 + [ 184 + date194307, date194212, "negative 7 months", 185 + ["years", 0, 7], 186 + ], 187 + [ 188 + date194307, date191912, "negative 23 years, 7 months", 189 + ["years", 23, 7], 190 + ], 191 + [ 192 + date194303, date194112, "negative 1 year, 3 months", 193 + ["years", 1, 3], 194 + ] 195 + ]; 196 + 197 + for (const [one, two, descr, ...units] of tests) { 198 + for (const [largestUnit, years, months] of units) { 199 + TemporalHelpers.assertDuration( 200 + one.since(two, { largestUnit }), 201 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 202 + descr 203 + ); 204 + } 205 + }
+204
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-islamic-civil.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (Islamic civil calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "islamic-civil"; 14 + 15 + // Years 16 + 17 + const date137702 = Temporal.PlainYearMonth.from({ year: 1377, monthCode: "M02", calendar }); 18 + const date137802 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M02", calendar }); 19 + const date137803 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M03", calendar }); 20 + const date141507 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M07", calendar }); 21 + const date141512 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M12", calendar }); 22 + const date141712 = Temporal.PlainYearMonth.from({ year: 1417, monthCode: "M12", calendar }); 23 + const date142106 = Temporal.PlainYearMonth.from({ year: 1421, monthCode: "M06", calendar }); 24 + const date143703 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M03", calendar }); 25 + const date143712 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M12", calendar }); 26 + const date143803 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M03", calendar }); 27 + const date143812 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M12", calendar }); 28 + const date143901 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M01", calendar }); 29 + const date143903 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M03", calendar }); 30 + const date143905 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M05", calendar }); 31 + const date143907 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M07", calendar }); 32 + const date143908 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M08", calendar }); 33 + const date144007 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M07", calendar }); 34 + const date144009 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M09", calendar }); 35 + const date144907 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M07", calendar }); 36 + const date144912 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M12", calendar }); 37 + 38 + const tests = [ 39 + [ 40 + date143907, date143907, "same day", 41 + ["years", 0, 0], 42 + ["months", 0, 0], 43 + ], 44 + [ 45 + date143907, date143908, "1 month in same year", 46 + ["years", 0, -1], 47 + ["months", 0, -1], 48 + ], 49 + [ 50 + date143812, date143901, "1 month in different year", 51 + ["years", 0, -1], 52 + ["months", 0, -1], 53 + ], 54 + [ 55 + date143903, date143905, "2 months which both have 30 days", 56 + ["years", 0, -2], 57 + ["months", 0, -2], 58 + ], 59 + [ 60 + date143907, date144007, "1 year", 61 + ["years", -1, 0], 62 + ["months", 0, -12], 63 + ], 64 + [ 65 + date143907, date144907, "10 years", 66 + ["years", -10, 0], 67 + ["months", 0, -120], 68 + ], 69 + [ 70 + date143907, date144009, "1 year 2 months", 71 + ["years", -1, -2], 72 + ], 73 + [ 74 + date143907, date144912, "10 years and 5 months", 75 + ["years", -10, -5], 76 + ], 77 + [ 78 + date141512, date143907, "23 years and 7 months", 79 + ["years", -23, -7], 80 + ], 81 + [ 82 + date141507, date143907, "24 years", 83 + ["years", -24, 0], 84 + ], 85 + [ 86 + date137802, date143803, "60 years, 1 month", 87 + ["years", -60, -1], 88 + ], 89 + [ 90 + date143903, date143907, "4 months", 91 + ["years", 0, -4], 92 + ], 93 + [ 94 + date143803, date143907, "1 year, 4 months", 95 + ["years", -1, -4], 96 + ], 97 + [ 98 + date141712, date142106, "3 years, 6 months", 99 + ["years", -3, -6], 100 + ], 101 + [ 102 + date137803, date143907, "61 years, 4 months", 103 + ["years", -61, -4], 104 + ], 105 + [ 106 + date143712, date143907, "1 year, 7 months", 107 + ["years", -1, -7], 108 + ], 109 + [ 110 + date143812, date143907, "7 months", 111 + ["years", 0, -7], 112 + ], 113 + [ 114 + date141512, date143907, "23 years, 7 months", 115 + ["years", -23, -7], 116 + ], 117 + [ 118 + date143712, date143903, "1 year, 3 months", 119 + ["years", -1, -3], 120 + ], 121 + [ 122 + date143908, date143907, "negative 1 month in same year", 123 + ["years", 0, 1], 124 + ["months", 0, 1], 125 + ], 126 + [ 127 + date143901, date143812, "negative 1 month in different year", 128 + ["years", 0, 1], 129 + ["months", 0, 1], 130 + ], 131 + [ 132 + date143907, date143905, "negative 2 months which both have 30 days", 133 + ["years", 0, 2], 134 + ["months", 0, 2], 135 + ], 136 + [ 137 + date144007, date143907, "negative 1 year", 138 + ["years", 1, 0], 139 + ["months", 0, 12], 140 + ], 141 + [ 142 + date144907, date143907, "negative 10 years", 143 + ["years", 10, 0], 144 + ["months", 0, 120], 145 + ], 146 + [ 147 + date144009, date143907, "negative 1 year 2 months", 148 + ["years", 1, 2], 149 + ], 150 + [ 151 + date144912, date143907, "negative 10 years and 5 months", 152 + ["years", 10, 5], 153 + ], 154 + [ 155 + date143907, date141512, "negative 23 years and 7 months", 156 + ["years", 23, 7], 157 + ], 158 + [ 159 + date143907, date141507, "negative 24 years", 160 + ["years", 24, 0], 161 + ], 162 + [ 163 + date143703, date137702, "negative 60 years, 1 month", 164 + ["years", 60, 1], 165 + ], 166 + [ 167 + date143907, date143903, "negative 4 months", 168 + ["years", 0, 4], 169 + ], 170 + [ 171 + date143907, date143803, "negative 1 year, 4 months", 172 + ["years", 1, 4], 173 + ], 174 + [ 175 + date143907, date137803, "negative 61 years, 4 months", 176 + ["years", 61, 4], 177 + ], 178 + [ 179 + date143907, date143712, "negative 1 year, 7 months", 180 + ["years", 1, 7], 181 + ], 182 + [ 183 + date143907, date143812, "negative 7 months", 184 + ["years", 0, 7], 185 + ], 186 + [ 187 + date143907, date141512, "negative 23 years, 7 months", 188 + ["years", 23, 7], 189 + ], 190 + [ 191 + date143903, date143712, "negative 1 year, 3 months", 192 + ["years", 1, 3], 193 + ] 194 + ]; 195 + 196 + for (const [one, two, descr, ...units] of tests) { 197 + for (const [largestUnit, years, months] of units) { 198 + TemporalHelpers.assertDuration( 199 + one.since(two, { largestUnit }), 200 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 201 + descr 202 + ); 203 + } 204 + }
+209
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-islamic-tbla.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (Islamic tbla calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "islamic-tbla"; 14 + 15 + // Years 16 + 17 + const date137702 = Temporal.PlainYearMonth.from({ year: 1377, monthCode: "M02", calendar }); 18 + const date137802 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M02", calendar }); 19 + const date137803 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M03", calendar }); 20 + const date141507 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M07", calendar }); 21 + const date141512 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M12", calendar }); 22 + const date141712 = Temporal.PlainYearMonth.from({ year: 1417, monthCode: "M12", calendar }); 23 + const date142001 = Temporal.PlainYearMonth.from({ year: 1420, monthCode: "M01", calendar }); 24 + const date142010 = Temporal.PlainYearMonth.from({ year: 1420, monthCode: "M10", calendar }); 25 + const date142106 = Temporal.PlainYearMonth.from({ year: 1421, monthCode: "M06", calendar }); 26 + const date143703 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M03", calendar }); 27 + const date143712 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M12", calendar }); 28 + const date143803 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M03", calendar }); 29 + const date143812 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M12", calendar }); 30 + const date143901 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M01", calendar }); 31 + const date143903 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M03", calendar });; 32 + const date143905 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M05", calendar }); 33 + const date143907 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M07", calendar }); 34 + const date143908 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M08", calendar }); 35 + const date144007 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M07", calendar }); 36 + const date144009 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M09", calendar }); 37 + const date144907 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M07", calendar }); 38 + const date144912 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M12", calendar }); 39 + 40 + const tests = [ 41 + [ 42 + date143907, date143907, "same day", 43 + ["years", 0, 0], 44 + ["months", 0, 0], 45 + ], 46 + [ 47 + date143907, date143908, "1 month in same year", 48 + ["years", 0, -1], 49 + ["months", 0, -1], 50 + ], 51 + [ 52 + date143812, date143901, "1 month in different year", 53 + ["years", 0, -1], 54 + ["months", 0, -1], 55 + ], 56 + [ 57 + date143903, date143905, "2 months which both have 30 days", 58 + ["years", 0, -2], 59 + ["months", 0, -2], 60 + ], 61 + [ 62 + date143907, date144007, "1 year", 63 + ["years", -1, 0], 64 + ["months", 0, -12], 65 + ], 66 + [ 67 + date143907, date144907, "10 years", 68 + ["years", -10, 0], 69 + ["months", 0, -120], 70 + ], 71 + [ 72 + date143907, date144009, "1 year 2 months", 73 + ["years", -1, -2], 74 + ], 75 + [ 76 + date143907, date144912, "10 years and 5 months", 77 + ["years", -10, -5], 78 + ], 79 + [ 80 + date141512, date143907, "23 years and 7 months", 81 + ["years", -23, -7], 82 + ], 83 + [ 84 + date141507, date143907, "24 years", 85 + ["years", -24, 0], 86 + ], 87 + [ 88 + date137802, date143803, "60 years, 1 month", 89 + ["years", -60, -1], 90 + ], 91 + [ 92 + date143903, date143907, "4 months", 93 + ["years", 0, -4], 94 + ], 95 + [ 96 + date143803, date143907, "1 year, 4 months", 97 + ["years", -1, -4], 98 + ], 99 + [ 100 + date141712, date142106, "3 years, 6 months", 101 + ["years", -3, -6], 102 + ], 103 + [ 104 + date137803, date143907, "61 years, 4 months", 105 + ["years", -61, -4], 106 + ], 107 + [ 108 + date143712, date143907, "1 year, 7 months", 109 + ["years", -1, -7], 110 + ], 111 + [ 112 + date143812, date143907, "7 months", 113 + ["years", 0, -7], 114 + ], 115 + [ 116 + date142001, date142010, "40 weeks", 117 + ], 118 + [ 119 + date141512, date143907, "23 years, 7 months", 120 + ["years", -23, -7], 121 + ], 122 + [ 123 + date143712, date143903, "1 year, 3 months", 124 + ["years", -1, -3], 125 + ], 126 + [ 127 + date143908, date143907, "negative 1 month in same year", 128 + ["years", 0, 1], 129 + ["months", 0, 1], 130 + ], 131 + [ 132 + date143901, date143812, "negative 1 month in different year", 133 + ["years", 0, 1], 134 + ["months", 0, 1], 135 + ], 136 + [ 137 + date143907, date143905, "negative 2 months which both have 30 days", 138 + ["years", 0, 2], 139 + ["months", 0, 2], 140 + ], 141 + [ 142 + date144007, date143907, "negative 1 year", 143 + ["years", 1, 0], 144 + ["months", 0, 12], 145 + ], 146 + [ 147 + date144907, date143907, "negative 10 years", 148 + ["years", 10, 0], 149 + ["months", 0, 120], 150 + ], 151 + [ 152 + date144009, date143907, "negative 1 year 2 months", 153 + ["years", 1, 2], 154 + ], 155 + [ 156 + date144912, date143907, "negative 10 years and 5 months", 157 + ["years", 10, 5], 158 + ], 159 + [ 160 + date143907, date141512, "negative 23 years and 7 months", 161 + ["years", 23, 7], 162 + ], 163 + [ 164 + date143907, date141507, "negative 24 years", 165 + ["years", 24, 0], 166 + ], 167 + [ 168 + date143703, date137702, "negative 60 years, 1 month", 169 + ["years", 60, 1], 170 + ], 171 + [ 172 + date143907, date143903, "negative 4 months", 173 + ["years", 0, 4], 174 + ], 175 + [ 176 + date143907, date143803, "negative 1 year, 4 months", 177 + ["years", 1, 4], 178 + ], 179 + [ 180 + date143907, date137803, "negative 61 years, 4 months", 181 + ["years", 61, 4], 182 + ], 183 + [ 184 + date143907, date143712, "negative 1 year, 7 months", 185 + ["years", 1, 7], 186 + ], 187 + [ 188 + date143907, date143812, "negative 7 months", 189 + ["years", 0, 7], 190 + ], 191 + [ 192 + date143907, date141512, "negative 23 years, 7 months", 193 + ["years", 23, 7], 194 + ], 195 + [ 196 + date143903, date143712, "negative 1 year, 3 months", 197 + ["years", 1, 3], 198 + ] 199 + ]; 200 + 201 + for (const [one, two, descr, ...units] of tests) { 202 + for (const [largestUnit, years, months] of units) { 203 + TemporalHelpers.assertDuration( 204 + one.since(two, { largestUnit }), 205 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 206 + descr 207 + ); 208 + } 209 + }
+204
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-islamic-umalqura.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (Islamic umalqura calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "islamic-umalqura"; 14 + 15 + // Years 16 + 17 + const date137702 = Temporal.PlainYearMonth.from({ year: 1377, monthCode: "M02", calendar }); 18 + const date137802 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M02", calendar }); 19 + const date137803 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M03", calendar }); 20 + const date141507 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M07", calendar }); 21 + const date141512 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M12", calendar }); 22 + const date141712 = Temporal.PlainYearMonth.from({ year: 1417, monthCode: "M12", calendar }); 23 + const date142106 = Temporal.PlainYearMonth.from({ year: 1421, monthCode: "M06", calendar }); 24 + const date143703 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M03", calendar }); 25 + const date143712 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M12", calendar }); 26 + const date143803 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M03", calendar }); 27 + const date143812 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M12", calendar }); 28 + const date143901 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M01", calendar }); 29 + const date143903 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M03", calendar }); 30 + const date143905 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M05", calendar }); 31 + const date143907 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M07", calendar }); 32 + const date143908 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M08", calendar }); 33 + const date144007 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M07", calendar }); 34 + const date144009 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M09", calendar }); 35 + const date144907 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M07", calendar }); 36 + const date144912 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M12", calendar }); 37 + 38 + const tests = [ 39 + [ 40 + date143907, date143907, "same day", 41 + ["years", 0, 0], 42 + ["months", 0, 0], 43 + ], 44 + [ 45 + date143907, date143908, "1 month in same year", 46 + ["years", 0, -1], 47 + ["months", 0, -1], 48 + ], 49 + [ 50 + date143812, date143901, "1 month in different year", 51 + ["years", 0, -1], 52 + ["months", 0, -1], 53 + ], 54 + [ 55 + date143903, date143905, "2 months which both have 30 days", 56 + ["years", 0, -2], 57 + ["months", 0, -2], 58 + ], 59 + [ 60 + date143907, date144007, "1 year", 61 + ["years", -1, 0], 62 + ["months", 0, -12], 63 + ], 64 + [ 65 + date143907, date144907, "10 years", 66 + ["years", -10, 0], 67 + ["months", 0, -120], 68 + ], 69 + [ 70 + date143907, date144009, "1 year 2 months", 71 + ["years", -1, -2], 72 + ], 73 + [ 74 + date143907, date144912, "10 years and 5 months", 75 + ["years", -10, -5], 76 + ], 77 + [ 78 + date141512, date143907, "23 years and 7 months", 79 + ["years", -23, -7], 80 + ], 81 + [ 82 + date141507, date143907, "24 years", 83 + ["years", -24, 0], 84 + ], 85 + [ 86 + date137802, date143803, "60 years, 1 month", 87 + ["years", -60, -1], 88 + ], 89 + [ 90 + date143903, date143907, "4 months", 91 + ["years", 0, -4], 92 + ], 93 + [ 94 + date143803, date143907, "1 year, 4 months", 95 + ["years", -1, -4], 96 + ], 97 + [ 98 + date141712, date142106, "3 years, 6 months", 99 + ["years", -3, -6], 100 + ], 101 + [ 102 + date137803, date143907, "61 years, 4 months", 103 + ["years", -61, -4], 104 + ], 105 + [ 106 + date143712, date143907, "1 year, 7 months", 107 + ["years", -1, -7], 108 + ], 109 + [ 110 + date143812, date143907, "7 months", 111 + ["years", 0, -7], 112 + ], 113 + [ 114 + date141512, date143907, "23 years, 7 months", 115 + ["years", -23, -7], 116 + ], 117 + [ 118 + date143712, date143903, "1 year, 3 months", 119 + ["years", -1, -3], 120 + ], 121 + [ 122 + date143908, date143907, "negative 1 month in same year", 123 + ["years", 0, 1], 124 + ["months", 0, 1], 125 + ], 126 + [ 127 + date143901, date143812, "negative 1 month in different year", 128 + ["years", 0, 1], 129 + ["months", 0, 1], 130 + ], 131 + [ 132 + date143907, date143905, "negative 2 months which both have 30 days", 133 + ["years", 0, 2], 134 + ["months", 0, 2], 135 + ], 136 + [ 137 + date144007, date143907, "negative 1 year", 138 + ["years", 1, 0], 139 + ["months", 0, 12], 140 + ], 141 + [ 142 + date144907, date143907, "negative 10 years", 143 + ["years", 10, 0], 144 + ["months", 0, 120], 145 + ], 146 + [ 147 + date144009, date143907, "negative 1 year 2 months", 148 + ["years", 1, 2], 149 + ], 150 + [ 151 + date144912, date143907, "negative 10 years and 5 months", 152 + ["years", 10, 5], 153 + ], 154 + [ 155 + date143907, date141512, "negative 23 years and 7 months", 156 + ["years", 23, 7], 157 + ], 158 + [ 159 + date143907, date141507, "negative 24 years", 160 + ["years", 24, 0], 161 + ], 162 + [ 163 + date143703, date137702, "negative 60 years, 1 month", 164 + ["years", 60, 1], 165 + ], 166 + [ 167 + date143907, date143903, "negative 4 months", 168 + ["years", 0, 4], 169 + ], 170 + [ 171 + date143907, date143803, "negative 1 year, 4 months", 172 + ["years", 1, 4], 173 + ], 174 + [ 175 + date143907, date137803, "negative 61 years, 4 months", 176 + ["years", 61, 4], 177 + ], 178 + [ 179 + date143907, date143712, "negative 1 year, 7 months", 180 + ["years", 1, 7], 181 + ], 182 + [ 183 + date143907, date143812, "negative 7 months", 184 + ["years", 0, 7], 185 + ], 186 + [ 187 + date143907, date141512, "negative 23 years, 7 months", 188 + ["years", 23, 7], 189 + ], 190 + [ 191 + date143903, date143712, "negative 1 year, 3 months", 192 + ["years", 1, 3], 193 + ] 194 + ]; 195 + 196 + for (const [one, two, descr, ...units] of tests) { 197 + for (const [largestUnit, years, months] of units) { 198 + TemporalHelpers.assertDuration( 199 + one.since(two, { largestUnit }), 200 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 201 + descr 202 + ); 203 + } 204 + }
+216
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-japanese.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (japanese calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "japanese"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196907 = Temporal.PlainYearMonth.from({ year: 1969, monthCode: "M07", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date200001 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M01", calendar }); 23 + const date200010 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M10", calendar }); 24 + const date200106 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M06", calendar }); 25 + const date201907 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M07", calendar }); 26 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 27 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 28 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 29 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 30 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar }); 31 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 32 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 33 + const date202109 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M09", calendar }); 34 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 35 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 36 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 37 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 38 + 39 + const tests = [ 40 + [ 41 + date202107, date202107, "same day", 42 + ["years", 0, 0], 43 + ["months", 0, 0], 44 + ], 45 + [ 46 + date202107, date202108, "1 month in same year", 47 + ["years", 0, -1], 48 + ["months", 0, -1], 49 + ], 50 + [ 51 + date202012, date202101, "1 month in different year", 52 + ["years", 0, -1], 53 + ["months", 0, -1], 54 + ], 55 + [ 56 + date202107, date202109, "2 months which both have 31 days", 57 + ["years", 0, -2], 58 + ["months", 0, -2], 59 + ], 60 + [ 61 + date202107, date202207, "1 year", 62 + ["years", -1, 0], 63 + ["months", 0, -12], 64 + ], 65 + [ 66 + date202107, date203107, "10 years", 67 + ["years", -10, 0], 68 + ["months", 0, -120], 69 + ], 70 + [ 71 + date202107, date202209, "1 year 2 months", 72 + ["years", -1, -2], 73 + ], 74 + [ 75 + date202107, date203112, "10 years and 5 months", 76 + ["years", -10, -5], 77 + ], 78 + [ 79 + date199712, date202107, "23 years and 7 months", 80 + ["years", -23, -7], 81 + ], 82 + [ 83 + date199707, date202107, "24 years", 84 + ["years", -24, 0], 85 + ], 86 + [ 87 + date196002, date202003, "60 years, 1 month", 88 + ["years", -60, -1], 89 + ], 90 + [ 91 + date202103, date202107, "4 months", 92 + ["years", 0, -4], 93 + ], 94 + [ 95 + date202003, date202107, "1 year, 4 months", 96 + ["years", -1, -4], 97 + ], 98 + [ 99 + date199712, date200106, "3 years, 6 months", 100 + ["years", -3, -6], 101 + ], 102 + [ 103 + date196003, date202107, "61 years, 4 months", 104 + ["years", -61, -4], 105 + ], 106 + [ 107 + date201912, date202107, "1 year, 7 months", 108 + ["years", -1, -7], 109 + ], 110 + [ 111 + date202012, date202107, "7 months", 112 + ["years", 0, -7], 113 + ], 114 + [ 115 + date200001, date200010, "40 weeks", 116 + ], 117 + [ 118 + date199712, date202107, "23 years, 7 months", 119 + ["years", -23, -7], 120 + ], 121 + [ 122 + date201912, date202103, "1 year, 3 months", 123 + ["years", -1, -3], 124 + ], 125 + [ 126 + date196907, date201907, "crossing epoch", 127 + ["years", -50, 0], 128 + ], 129 + [ 130 + date202108, date202107, "negative 1 month in same year", 131 + ["years", 0, 1], 132 + ["months", 0, 1], 133 + ], 134 + [ 135 + date202101, date202012, "negative 1 month in different year", 136 + ["years", 0, 1], 137 + ["months", 0, 1], 138 + ], 139 + [ 140 + date202109, date202107, "negative 2 months which both have 31 days", 141 + ["years", 0, 2], 142 + ["months", 0, 2], 143 + ], 144 + [ 145 + date202207, date202107, "negative 1 year", 146 + ["years", 1, 0], 147 + ["months", 0, 12], 148 + ], 149 + [ 150 + date203107, date202107, "negative 10 years", 151 + ["years", 10, 0], 152 + ["months", 0, 120], 153 + ], 154 + [ 155 + date202209, date202107, "negative 1 year 2 months", 156 + ["years", 1, 2], 157 + ], 158 + [ 159 + date203112, date202107, "negative 10 years and 5 months", 160 + ["years", 10, 5], 161 + ], 162 + [ 163 + date202107, date199712, "negative 23 years and 7 months", 164 + ["years", 23, 7], 165 + ], 166 + [ 167 + date202107, date199707, "negative 24 years", 168 + ["years", 24, 0], 169 + ], 170 + [ 171 + date202003, date196002, "negative 60 years, 1 month", 172 + ["years", 60, 1], 173 + ], 174 + [ 175 + date202107, date202103, "negative 4 months", 176 + ["years", 0, 4], 177 + ], 178 + [ 179 + date202107, date202003, "negative 1 year, 4 months", 180 + ["years", 1, 4], 181 + ], 182 + [ 183 + date202107, date196003, "negative 61 years, 4 months", 184 + ["years", 61, 4], 185 + ], 186 + [ 187 + date202107, date201912, "negative 1 year, 7 months", 188 + ["years", 1, 7], 189 + ], 190 + [ 191 + date202107, date202012, "negative 7 months", 192 + ["years", 0, 7], 193 + ], 194 + [ 195 + date202107, date199712, "negative 23 years, 7 months", 196 + ["years", 23, 7], 197 + ], 198 + [ 199 + date202103, date201912, "negative 1 year, 3 months", 200 + ["years", 1, 3], 201 + ], 202 + [ 203 + date201907, date196907, "crossing epoch", 204 + ["years", 50, 0], 205 + ], 206 + ]; 207 + 208 + for (const [one, two, descr, ...units] of tests) { 209 + for (const [largestUnit, years, months] of units) { 210 + TemporalHelpers.assertDuration( 211 + one.since(two, { largestUnit }), 212 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 213 + descr 214 + ); 215 + } 216 + }
+211
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-persian.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (Persian calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "persian"; 14 + 15 + // Years 16 + 17 + const date137512 = Temporal.PlainYearMonth.from({ year: 1375, monthCode: "M12", calendar }); 18 + const date137906 = Temporal.PlainYearMonth.from({ year: 1379, monthCode: "M06", calendar }); 19 + const date134202 = Temporal.PlainYearMonth.from({ year: 1342, monthCode: "M02", calendar }); 20 + const date134302 = Temporal.PlainYearMonth.from({ year: 1343, monthCode: "M02", calendar }); 21 + const date134303 = Temporal.PlainYearMonth.from({ year: 1343, monthCode: "M03", calendar }); 22 + const date138007 = Temporal.PlainYearMonth.from({ year: 1380, monthCode: "M07", calendar }); 23 + const date138012 = Temporal.PlainYearMonth.from({ year: 1380, monthCode: "M12", calendar }); 24 + const date140203 = Temporal.PlainYearMonth.from({ year: 1402, monthCode: "M03", calendar }); 25 + const date140212 = Temporal.PlainYearMonth.from({ year: 1402, monthCode: "M12", calendar }); 26 + const date140303 = Temporal.PlainYearMonth.from({ year: 1403, monthCode: "M03", calendar }); 27 + const date140312 = Temporal.PlainYearMonth.from({ year: 1403, monthCode: "M12", calendar }); 28 + const date140401 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M01", calendar }); 29 + const date140403 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M03", calendar }); 30 + const date140404 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M04", calendar }); 31 + const date140406 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M06", calendar }); 32 + const date140407 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M07", calendar }); 33 + const date140408 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M08", calendar }); 34 + const date140409 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M09", calendar }); 35 + const date140507 = Temporal.PlainYearMonth.from({ year: 1405, monthCode: "M07", calendar }); 36 + const date140509 = Temporal.PlainYearMonth.from({ year: 1405, monthCode: "M09", calendar }); 37 + const date141407 = Temporal.PlainYearMonth.from({ year: 1414, monthCode: "M07", calendar }); 38 + const date141412 = Temporal.PlainYearMonth.from({ year: 1414, monthCode: "M12", calendar }); 39 + 40 + const tests = [ 41 + [ 42 + date140407, date140407, "same day", 43 + ["years", 0, 0], 44 + ["months", 0, 0], 45 + ], 46 + [ 47 + date140407, date140408, "1 month in same year", 48 + ["years", 0, -1], 49 + ["months", 0, -1], 50 + ], 51 + [ 52 + date140312, date140401, "1 month in different year", 53 + ["years", 0, -1], 54 + ["months", 0, -1], 55 + ], 56 + [ 57 + date140407, date140409, "2 months which both have 30 days", 58 + ["years", 0, -2], 59 + ["months", 0, -2], 60 + ], 61 + [ 62 + date140404, date140406, "2 months which both have 31 days", 63 + ["years", 0, -2], 64 + ["months", 0, -2], 65 + ], 66 + [ 67 + date140407, date140507, "1 year", 68 + ["years", -1, 0], 69 + ["months", 0, -12], 70 + ], 71 + [ 72 + date140407, date141407, "10 years", 73 + ["years", -10, 0], 74 + ["months", 0, -120], 75 + ], 76 + [ 77 + date140407, date140509, "1 year 2 months", 78 + ["years", -1, -2], 79 + ], 80 + [ 81 + date137512, date137906, "3 years, 6 months", 82 + ["years", -3, -6], 83 + ], 84 + [ 85 + date140407, date141412, "10 years and 5 months", 86 + ["years", -10, -5], 87 + ], 88 + [ 89 + date138012, date140407, "23 years and 7 months", 90 + ["years", -23, -7], 91 + ], 92 + [ 93 + date138007, date140407, "24 years", 94 + ["years", -24, 0], 95 + ], 96 + [ 97 + date134302, date140303, "60 years, 1 month", 98 + ["years", -60, -1], 99 + ], 100 + [ 101 + date140403, date140407, "4 months", 102 + ["years", 0, -4], 103 + ], 104 + [ 105 + date140303, date140407, "1 year, 4 months", 106 + ["years", -1, -4], 107 + ], 108 + [ 109 + date134303, date140407, "61 years, 4 months", 110 + ["years", -61, -4], 111 + ], 112 + [ 113 + date140212, date140407, "1 year, 7 months", 114 + ["years", -1, -7], 115 + ], 116 + [ 117 + date140312, date140407, "7 months", 118 + ["years", 0, -7], 119 + ], 120 + [ 121 + date138012, date140407, "23 years, 7 months", 122 + ["years", -23, -7], 123 + ], 124 + [ 125 + date140212, date140403, "1 year, 3 months", 126 + ["years", -1, -3], 127 + ], 128 + [ 129 + date140408, date140407, "negative 1 month in same year", 130 + ["years", 0, 1], 131 + ["months", 0, 1], 132 + ], 133 + [ 134 + date140401, date140312, "negative 1 month in different year", 135 + ["years", 0, 1], 136 + ["months", 0, 1], 137 + ], 138 + [ 139 + date140409, date140407, "negative 2 months which both have 30 days", 140 + ["years", 0, 2], 141 + ["months", 0, 2], 142 + ], 143 + [ 144 + date140507, date140407, "negative 1 year", 145 + ["years", 1, 0], 146 + ["months", 0, 12], 147 + ], 148 + [ 149 + date141407, date140407, "negative 10 years", 150 + ["years", 10, 0], 151 + ["months", 0, 120], 152 + ], 153 + [ 154 + date140509, date140407, "negative 1 year 2 months", 155 + ["years", 1, 2], 156 + ], 157 + [ 158 + date141412, date140407, "negative 10 years and 5 months", 159 + ["years", 10, 5], 160 + ], 161 + [ 162 + date140407, date138012, "negative 23 years and 7 months", 163 + ["years", 23, 7], 164 + ], 165 + [ 166 + date140407, date138007, "negative 24 years", 167 + ["years", 24, 0], 168 + ], 169 + [ 170 + date140203, date134202, "negative 60 years, 1 month", 171 + ["years", 60, 1], 172 + ], 173 + [ 174 + date140407, date140403, "negative 4 months", 175 + ["years", 0, 4], 176 + ], 177 + [ 178 + date140407, date140303, "negative 1 year, 4 months", 179 + ["years", 1, 4], 180 + ], 181 + [ 182 + date140407, date134303, "negative 61 years, 4 months", 183 + ["years", 61, 4], 184 + ], 185 + [ 186 + date140407, date140212, "negative 1 year, 7 months", 187 + ["years", 1, 7], 188 + ], 189 + [ 190 + date140407, date140312, "negative 7 months", 191 + ["years", 0, 7], 192 + ], 193 + [ 194 + date140407, date138012, "negative 23 years, 7 months", 195 + ["years", 23, 7], 196 + ], 197 + [ 198 + date140403, date140212, "negative 1 year, 3 months", 199 + ["years", 1, 3], 200 + ] 201 + ]; 202 + 203 + for (const [one, two, descr, ...units] of tests) { 204 + for (const [largestUnit, years, months] of units) { 205 + TemporalHelpers.assertDuration( 206 + one.since(two, { largestUnit }), 207 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 208 + descr 209 + ); 210 + } 211 + }
+211
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/basic-roc.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (roc calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "roc"; 14 + 15 + // Years 16 + 17 + const date04902 = Temporal.PlainYearMonth.from({ year: 49, monthCode: "M02", calendar }); 18 + const date04903 = Temporal.PlainYearMonth.from({ year: 49, monthCode: "M03", calendar }); 19 + const date05807 = Temporal.PlainYearMonth.from({ year: 58, monthCode: "M07", calendar }); 20 + const date08607 = Temporal.PlainYearMonth.from({ year: 86, monthCode: "M07", calendar }); 21 + const date08612 = Temporal.PlainYearMonth.from({ year: 86, monthCode: "M12", calendar }); 22 + const date09006 = Temporal.PlainYearMonth.from({ year: 90, monthCode: "M06", calendar }); 23 + const date10807 = Temporal.PlainYearMonth.from({ year: 108, monthCode: "M07", calendar }); 24 + const date10812 = Temporal.PlainYearMonth.from({ year: 108, monthCode: "M12", calendar }); 25 + const date10903 = Temporal.PlainYearMonth.from({ year: 109, monthCode: "M03", calendar }); 26 + const date10912 = Temporal.PlainYearMonth.from({ year: 109, monthCode: "M12", calendar }); 27 + const date11001 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M01", calendar }); 28 + const date11003 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M03", calendar }); 29 + const date11007 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M07", calendar }); 30 + const date11008 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M08", calendar }); 31 + const date11009 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M09", calendar }); 32 + const date11107 = Temporal.PlainYearMonth.from({ year: 111, monthCode: "M07", calendar }); 33 + const date11109 = Temporal.PlainYearMonth.from({ year: 111, monthCode: "M09", calendar }); 34 + const date12007 = Temporal.PlainYearMonth.from({ year: 120, monthCode: "M07", calendar }); 35 + const date12012 = Temporal.PlainYearMonth.from({ year: 120, monthCode: "M12", calendar }); 36 + 37 + const tests = [ 38 + [ 39 + date11007, date11007, "same day", 40 + ["years", 0, 0], 41 + ["months", 0, 0], 42 + ], 43 + [ 44 + date11007, date11008, "1 month in same year", 45 + ["years", 0, -1], 46 + ["months", 0, -1], 47 + ], 48 + [ 49 + date10912, date11001, "1 month in different year", 50 + ["years", 0, -1], 51 + ["months", 0, -1], 52 + ], 53 + [ 54 + date11007, date11009, "2 months which both have 31 days", 55 + ["years", 0, -2], 56 + ["months", 0, -2], 57 + ], 58 + [ 59 + date11007, date11107, "1 year", 60 + ["years", -1, 0], 61 + ["months", 0, -12], 62 + ], 63 + [ 64 + date11007, date12007, "10 years", 65 + ["years", -10, 0], 66 + ["months", 0, -120], 67 + ], 68 + [ 69 + date11007, date11109, "1 year 2 months", 70 + ["years", -1, -2], 71 + ], 72 + [ 73 + date11007, date12012, "10 years and 5 months", 74 + ["years", -10, -5], 75 + ], 76 + [ 77 + date08612, date11007, "23 years and 7 months", 78 + ["years", -23, -7], 79 + ], 80 + [ 81 + date08607, date11007, "24 years", 82 + ["years", -24, 0], 83 + ], 84 + [ 85 + date04902, date10903, "60 years, 1 month", 86 + ["years", -60, -1], 87 + ], 88 + [ 89 + date11003, date11007, "4 months", 90 + ["years", 0, -4], 91 + ], 92 + [ 93 + date10903, date11007, "1 year, 4 months", 94 + ["years", -1, -4], 95 + ], 96 + [ 97 + date04903, date11007, "61 years, 4 months", 98 + ["years", -61, -4], 99 + ], 100 + [ 101 + date10812, date11007, "1 year, 7 months", 102 + ["years", -1, -7], 103 + ], 104 + [ 105 + date08612, date09006, "3 years, 6 months", 106 + ["years", -3, -6], 107 + ], 108 + [ 109 + date10912, date11007, "7 months", 110 + ["years", 0, -7], 111 + ], 112 + [ 113 + date08612, date11007, "23 years, 7 months", 114 + ["years", -23, -7], 115 + ], 116 + [ 117 + date10812, date11003, "1 year, 3 months", 118 + ["years", -1, -3], 119 + ], 120 + [ 121 + date05807, date10807, "crossing epoch", 122 + ["years", -50, 0], 123 + ], 124 + [ 125 + date11008, date11007, "negative 1 month in same year", 126 + ["years", 0, 1], 127 + ["months", 0, 1], 128 + ], 129 + [ 130 + date11001, date10912, "negative 1 month in different year", 131 + ["years", 0, 1], 132 + ["months", 0, 1], 133 + ], 134 + [ 135 + date11009, date11007, "negative 2 months which both have 31 days", 136 + ["years", 0, 2], 137 + ["months", 0, 2], 138 + ], 139 + [ 140 + date11107, date11007, "negative 1 year", 141 + ["years", 1, 0], 142 + ["months", 0, 12], 143 + ], 144 + [ 145 + date12007, date11007, "negative 10 years", 146 + ["years", 10, 0], 147 + ["months", 0, 120], 148 + ], 149 + [ 150 + date11109, date11007, "negative 1 year 2 months", 151 + ["years", 1, 2], 152 + ], 153 + [ 154 + date12012, date11007, "negative 10 years and 5 months", 155 + ["years", 10, 5], 156 + ], 157 + [ 158 + date11007, date08612, "negative 23 years and 7 months", 159 + ["years", 23, 7], 160 + ], 161 + [ 162 + date11007, date08607, "negative 24 years", 163 + ["years", 24, 0], 164 + ], 165 + [ 166 + date10903, date04902, "negative 60 years, 1 month", 167 + ["years", 60, 1], 168 + ], 169 + [ 170 + date11007, date11003, "negative 4 months", 171 + ["years", 0, 4], 172 + ], 173 + [ 174 + date11007, date10903, "negative 1 year, 4 months", 175 + ["years", 1, 4], 176 + ], 177 + [ 178 + date11007, date04903, "negative 61 years, 4 months", 179 + ["years", 61, 4], 180 + ], 181 + [ 182 + date11007, date10812, "negative 1 year, 7 months", 183 + ["years", 1, 7], 184 + ], 185 + [ 186 + date11007, date10912, "negative 7 months", 187 + ["years", 0, 7], 188 + ], 189 + [ 190 + date11007, date08612, "negative 23 years, 7 months", 191 + ["years", 23, 7], 192 + ], 193 + [ 194 + date11003, date10812, "negative 1 year, 3 months", 195 + ["years", 1, 3], 196 + ], 197 + [ 198 + date10807, date05807, "crossing epoch", 199 + ["years", 50, 0], 200 + ], 201 + ]; 202 + 203 + for (const [one, two, descr, ...units] of tests) { 204 + for (const [largestUnit, years, months] of units) { 205 + TemporalHelpers.assertDuration( 206 + one.since(two, { largestUnit }), 207 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 208 + descr 209 + ); 210 + } 211 + }
+12
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/calendar-mismatch.js
··· 1 + // Copyright (C) 2021 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: RangeError thrown if calendars' IDs do not match 7 + features: [Temporal] 8 + ---*/ 9 + 10 + const plainYearMonth1 = new Temporal.PlainYearMonth(2000, 1, "gregory", 1); 11 + const plainYearMonth2 = new Temporal.PlainYearMonth(2000, 1, "japanese", 1); 12 + assert.throws(RangeError, () => plainYearMonth1.since(plainYearMonth2));
+77
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/era-boundary-ethiopic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "ethiopic"; 12 + const options = { overflow: "reject" }; 13 + 14 + const aa5500 = Temporal.PlainYearMonth.from({ era: "aa", eraYear: 5500, monthCode: "M01", calendar }, options); 15 + const am1 = Temporal.PlainYearMonth.from({ era: "am", eraYear: 1, monthCode: "M01", calendar }, options); 16 + const am2000 = Temporal.PlainYearMonth.from({ era: "am", eraYear: 2000, monthCode: "M06", calendar }, options); 17 + const am2005 = Temporal.PlainYearMonth.from({ era: "am", eraYear: 2005, monthCode: "M06", calendar }, options); 18 + const aa5450 = Temporal.PlainYearMonth.from({ era: "aa", eraYear: 5450, monthCode: "M07", calendar }, options); 19 + const aa5455 = Temporal.PlainYearMonth.from({ era: "aa", eraYear: 5455, monthCode: "M07", calendar }, options); 20 + const am5 = Temporal.PlainYearMonth.from({ era: "am", eraYear: 5, monthCode: "M01", calendar }, options); 21 + 22 + const tests = [ 23 + // From 5500 AA to 1 AM 24 + [ 25 + aa5500, am1, 26 + [-1, 0, "-1y backwards from 5500 AA to 1 AM"], 27 + [0, -13, "-13mo backwards from 5500 AA to 1 AM"], 28 + ], 29 + [ 30 + am1, aa5500, 31 + [1, 0, "1y from 5500 AA to 1 AM"], 32 + [0, 13, "13mo from 1 AM to 5500 AA"], 33 + ], 34 + // From 2000 AM to 2005 AM 35 + [ 36 + am2000, am2005, 37 + [-5, 0, "-5y backwards from 2000 AM to 2005 AM"], 38 + [0, -65, "-65mo backwards from 2000 AM to 2005 AM"], 39 + ], 40 + [ 41 + am2005, am2000, 42 + [5, 0, "5y from 2000 AM to 2005 AM"], 43 + [0, 65, "65mo from 2000 AM to 2005 AM"], 44 + ], 45 + // From 5450 AA to 5455 AA 46 + [ 47 + aa5450, aa5455, 48 + [-5, 0, "-5y backwards from 5450 AA to 5455 AA"], 49 + [0, -65, "-65mo backwards from 5450 AA to 5455 AA"], 50 + ], 51 + [ 52 + aa5455, aa5450, 53 + [5, 0, "5y from 5450 AA to 5455 AA"], 54 + [0, 65, "65mo from 5450 AA to 5455 AA"], 55 + ], 56 + // From 5 AM to 5500 AA 57 + [ 58 + aa5500, am5, 59 + [-5, 0, "-5y backwards from 5 AM to 5500 AA"], 60 + [0, -65, "-65mo backwards from 5 AM to 5500 AA"], 61 + ], 62 + [ 63 + am5, aa5500, 64 + [5, 0, "5y from 5 AM to 5500 AA"], 65 + [0, 65, "65mo from 5 AM to 5500 AA"], 66 + ], 67 + ]; 68 + 69 + for (const [one, two, yearsTest, monthsTest] of tests) { 70 + let [years, months, descr] = yearsTest; 71 + let result = one.since(two, { largestUnit: "years" }); 72 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 73 + 74 + [years, months, descr] = monthsTest; 75 + result = one.since(two, { largestUnit: "months" }); 76 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 77 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/era-boundary-gregory.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "gregory"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bce5 = Temporal.PlainYearMonth.from({ era: "bce", eraYear: 5, monthCode: "M06", calendar }, options); 15 + const bce2 = Temporal.PlainYearMonth.from({ era: "bce", eraYear: 2, monthCode: "M12", calendar }, options); 16 + const bce1 = Temporal.PlainYearMonth.from({ era: "bce", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const ce1 = Temporal.PlainYearMonth.from({ era: "ce", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const ce2 = Temporal.PlainYearMonth.from({ era: "ce", eraYear: 2, monthCode: "M01", calendar }, options); 19 + const ce5 = Temporal.PlainYearMonth.from({ era: "ce", eraYear: 5, monthCode: "M06", calendar }, options); 20 + 21 + const tests = [ 22 + // From 5 BCE to 5 CE 23 + [ 24 + bce5, ce5, 25 + [-9, 0, "-9y backwards from 5 BCE to 5 CE (no year 0)"], 26 + [0, -108, "-108mo backwards from 5 BCE to 5 CE (no year 0)"], 27 + ], 28 + [ 29 + ce5, bce5, 30 + [9, 0, "9y from 5 BCE to 5 CE (no year 0)"], 31 + [0, 108, "108mo from 5 BCE to 5 CE (no year 0)"], 32 + ], 33 + // CE-BCE boundary 34 + [ 35 + bce1, ce1, 36 + [-1, 0, "-1y backwards from 1 BCE to 1 CE"], 37 + [0, -12, "-12mo backwards from 1 BCE to 1 CE"], 38 + ], 39 + [ 40 + ce1, bce1, 41 + [1, 0, "1y from 1 BCE to 1 CE"], 42 + [0, 12, "12mo from 1 BCE to 1 CE"], 43 + ], 44 + [ 45 + bce2, ce2, 46 + [-2, -1, "-2y -1mo backwards from 2 BCE Dec to 2 CE Jan"], 47 + [0, -25, "-25mo backwards from 2 BCE Dec to 2 CE Jan"], 48 + ], 49 + [ 50 + ce2, bce2, 51 + [2, 1, "2y 1mo from 2 BCE Dec to 2 CE Jan"], 52 + [0, 25, "25mo from 2 BCE Dec to 2 CE Jan"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.since(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.since(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/era-boundary-islamic-civil.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "islamic-civil"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bh5 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 5, monthCode: "M06", calendar }, options); 15 + const bh2 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 2, monthCode: "M12", calendar }, options); 16 + const bh1 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const ah1 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const ah2 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 2, monthCode: "M01", calendar }, options); 19 + const ah5 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 5, monthCode: "M06", calendar }, options); 20 + 21 + const tests = [ 22 + // From 5 BH to 5 AH 23 + [ 24 + bh5, ah5, 25 + [-9, 0, "-9y backwards from 5 BH to 5 AH (no year 0)"], 26 + [0, -108, "-108mo backwards from 5 BH to 5 AH (no year 0)"], 27 + ], 28 + [ 29 + ah5, bh5, 30 + [9, 0, "9y from 5 BH to 5 AH (no year 0)"], 31 + [0, 108, "108mo from 5 BH to 5 AH (no year 0)"], 32 + ], 33 + // AH-BH boundary 34 + [ 35 + bh1, ah1, 36 + [-1, 0, "-1y backwards from 1 BH to 1 AH"], 37 + [0, -12, "-12mo backwards from 1 BH to 1 AH"], 38 + ], 39 + [ 40 + ah1, bh1, 41 + [1, 0, "1y from 1 BH to 1 AH"], 42 + [0, 12, "12mo from 1 BH to 1 AH"], 43 + ], 44 + [ 45 + bh2, ah2, 46 + [-2, -1, "-2y -1mo backwards from 2 BH Dec to 2 AH Jan"], 47 + [0, -25, "-25mo backwards from 2 BH Dec to 2 AH Jan"], 48 + ], 49 + [ 50 + ah2, bh2, 51 + [2, 1, "2y 1mo from 2 BH Dec to 2 AH Jan"], 52 + [0, 25, "25mo from 2 BH Dec to 2 AH Jan"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.since(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.since(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/era-boundary-islamic-tbla.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "islamic-tbla"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bh5 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 5, monthCode: "M06", calendar }, options); 15 + const bh2 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 2, monthCode: "M12", calendar }, options); 16 + const bh1 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const ah1 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const ah2 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 2, monthCode: "M01", calendar }, options); 19 + const ah5 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 5, monthCode: "M06", calendar }, options); 20 + 21 + const tests = [ 22 + // From 5 BH to 5 AH 23 + [ 24 + bh5, ah5, 25 + [-9, 0, "-9y backwards from 5 BH to 5 AH (no year 0)"], 26 + [0, -108, "-108mo backwards from 5 BH to 5 AH (no year 0)"], 27 + ], 28 + [ 29 + ah5, bh5, 30 + [9, 0, "9y from 5 BH to 5 AH (no year 0)"], 31 + [0, 108, "108mo from 5 BH to 5 AH (no year 0)"], 32 + ], 33 + // AH-BH boundary 34 + [ 35 + bh1, ah1, 36 + [-1, 0, "-1y backwards from 1 BH to 1 AH"], 37 + [0, -12, "-12mo backwards from 1 BH to 1 AH"], 38 + ], 39 + [ 40 + ah1, bh1, 41 + [1, 0, "1y from 1 BH to 1 AH"], 42 + [0, 12, "12mo from 1 BH to 1 AH"], 43 + ], 44 + [ 45 + bh2, ah2, 46 + [-2, -1, "-2y -1mo backwards from 2 BH Dec to 2 AH Jan"], 47 + [0, -25, "-25mo backwards from 2 BH Dec to 2 AH Jan"], 48 + ], 49 + [ 50 + ah2, bh2, 51 + [2, 1, "2y 1mo from 2 BH Dec to 2 AH Jan"], 52 + [0, 25, "25mo from 2 BH Dec to 2 AH Jan"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.since(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.since(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/era-boundary-islamic-umalqura.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "islamic-umalqura"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bh5 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 5, monthCode: "M06", calendar }, options); 15 + const bh2 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 2, monthCode: "M12", calendar }, options); 16 + const bh1 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const ah1 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const ah2 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 2, monthCode: "M01", calendar }, options); 19 + const ah5 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 5, monthCode: "M06", calendar }, options); 20 + 21 + const tests = [ 22 + // From 5 BH to 5 AH 23 + [ 24 + bh5, ah5, 25 + [-9, 0, "-9y backwards from 5 BH to 5 AH (no year 0)"], 26 + [0, -108, "-108mo backwards from 5 BH to 5 AH (no year 0)"], 27 + ], 28 + [ 29 + ah5, bh5, 30 + [9, 0, "9y from 5 BH to 5 AH (no year 0)"], 31 + [0, 108, "108mo from 5 BH to 5 AH (no year 0)"], 32 + ], 33 + // AH-BH boundary 34 + [ 35 + bh1, ah1, 36 + [-1, 0, "-1y backwards from 1 BH to 1 AH"], 37 + [0, -12, "-12mo backwards from 1 BH to 1 AH"], 38 + ], 39 + [ 40 + ah1, bh1, 41 + [1, 0, "1y from 1 BH to 1 AH"], 42 + [0, 12, "12mo from 1 BH to 1 AH"], 43 + ], 44 + [ 45 + bh2, ah2, 46 + [-2, -1, "-2y -1mo backwards from 2 BH Dec to 2 AH Jan"], 47 + [0, -25, "-25mo backwards from 2 BH Dec to 2 AH Jan"], 48 + ], 49 + [ 50 + ah2, bh2, 51 + [2, 1, "2y 1mo from 2 BH Dec to 2 AH Jan"], 52 + [0, 25, "25mo from 2 BH Dec to 2 AH Jan"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.since(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.since(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+127
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/era-boundary-japanese.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "japanese"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bce1 = Temporal.PlainYearMonth.from({ era: "bce", eraYear: 1, monthCode: "M06", calendar }, options); 15 + const ce1 = Temporal.PlainYearMonth.from({ era: "ce", eraYear: 1, monthCode: "M06", calendar }, options); 16 + const meiji5 = Temporal.PlainYearMonth.from({ era: "meiji", eraYear: 5, monthCode: "M01", calendar }, options); 17 + const meiji45 = Temporal.PlainYearMonth.from({ era: "meiji", eraYear: 45, monthCode: "M05", calendar }, options); 18 + const taisho1 = Temporal.PlainYearMonth.from({ era: "taisho", eraYear: 1, monthCode: "M08", calendar }, options); 19 + const taisho6 = Temporal.PlainYearMonth.from({ era: "taisho", eraYear: 6, monthCode: "M03", calendar }, options); 20 + const showa55 = Temporal.PlainYearMonth.from({ era: "showa", eraYear: 55, monthCode: "M03", calendar }, options); 21 + const showa64 = Temporal.PlainYearMonth.from({ era: "showa", eraYear: 64, monthCode: "M01", calendar }, options); 22 + const heisei1 = Temporal.PlainYearMonth.from({ era: "heisei", eraYear: 1, monthCode: "M02", calendar }, options); 23 + const heisei30 = Temporal.PlainYearMonth.from({ era: "heisei", eraYear: 30, monthCode: "M03", calendar }, options); 24 + const heisei31 = Temporal.PlainYearMonth.from({ era: "heisei", eraYear: 31, monthCode: "M04", calendar }, options); 25 + const reiwa1 = Temporal.PlainYearMonth.from({ era: "reiwa", eraYear: 1, monthCode: "M06", calendar }, options); 26 + const reiwa2 = Temporal.PlainYearMonth.from({ era: "reiwa", eraYear: 2, monthCode: "M03", calendar }, options); 27 + 28 + const tests = [ 29 + // From Heisei 30 (2018) to Reiwa 2 (2020) - crossing era boundary 30 + [ 31 + heisei30, reiwa2, 32 + [-2, 0, "-2y backwards from Heisei 30 March to Reiwa 2 March"], 33 + [0, -24, "-24mo backwards from Heisei 30 March to Reiwa 2 March"], 34 + ], 35 + [ 36 + reiwa2, heisei30, 37 + [2, 0, "2y from Heisei 30 March to Reiwa 2 March"], 38 + [0, 24, "24mo from Heisei 30 March to Reiwa 2 March"], 39 + ], 40 + // Within same year but different eras 41 + [ 42 + heisei31, reiwa1, 43 + [0, -2, "-2mo backwards from Heisei 31 April to Reiwa 1 June"], 44 + [0, -2, "-2mo backwards from Heisei 31 April to Reiwa 1 June"], 45 + ], 46 + [ 47 + reiwa1, heisei31, 48 + [0, 2, "2mo from Heisei 31 April to Reiwa 1 June"], 49 + [0, 2, "2mo from Heisei 31 April to Reiwa 1 June"], 50 + ], 51 + // From Showa 55 (1980) to Heisei 30 (2018) - crossing era boundary 52 + [ 53 + showa55, heisei30, 54 + [-38, 0, "-38y backwards from Showa 55 March to Heisei 30 March"], 55 + [0, -456, "-456mo backwards from Showa 55 March to Heisei 30 March"], 56 + ], 57 + [ 58 + heisei30, showa55, 59 + [38, 0, "38y from Showa 55 March to Heisei 30 March"], 60 + [0, 456, "456mo from Showa 55 March to Heisei 30 March"], 61 + ], 62 + // Within same year but different eras 63 + [ 64 + showa64, heisei1, 65 + [0, -1, "-1mo from Showa 64 January to Heisei 1 February"], 66 + [0, -1, "-1mo from Showa 64 January to Heisei 1 February"], 67 + ], 68 + [ 69 + heisei1, showa64, 70 + [0, 1, "1mo from Showa 64 January to Heisei 1 February"], 71 + [0, 1, "1mo from Showa 64 January to Heisei 1 February"], 72 + ], 73 + // From Taisho 6 (1917) to Showa 55 (1980) - crossing era boundary 74 + [ 75 + taisho6, showa55, 76 + [-63, 0, "-63y backwards from Taisho 6 March to Showa 55 March"], 77 + [0, -756, "-756mo backwards from Taisho 6 March to Showa 55 March"], 78 + ], 79 + [ 80 + showa55, taisho6, 81 + [63, 0, "63y from Taisho 6 March to Showa 55 March"], 82 + [0, 756, "756mo from Taisho 6 March to Showa 55 March"], 83 + ], 84 + // From Meiji 5 (1872) to Taisho 6 (1917) - crossing era boundary 85 + [ 86 + meiji5, taisho6, 87 + [-45, -2, "-45y -2mo backwards from Meiji 5 January to Taisho 6 March"], 88 + [0, -542, "-542mo backwards from Meiji 5 January to Taisho 6 March"], 89 + ], 90 + [ 91 + taisho6, meiji5, 92 + [45, 2, "45y 2mo from Meiji 5 January to Taisho 6 March"], 93 + [0, 542, "542mo from Meiji 5 January to Taisho 6 March"], 94 + ], 95 + // Within same year but different eras 96 + [ 97 + meiji45, taisho1, 98 + [0, -3, "-3mo backwards from Meiji 45 May to Taisho 1 August"], 99 + [0, -3, "-3mo backwards from Meiji 45 May to Taisho 1 August"], 100 + ], 101 + [ 102 + taisho1, meiji45, 103 + [0, 3, "3mo from Meiji 45 May to Taisho 1 August"], 104 + [0, 3, "3mo from Meiji 45 May to Taisho 1 August"], 105 + ], 106 + // CE-BCE boundary 107 + [ 108 + bce1, ce1, 109 + [-1, 0, "-1y backwards from 1 BCE to 1 CE"], 110 + [0, -12, "-12mo backwards from 1 BCE to 1 CE"], 111 + ], 112 + [ 113 + ce1, bce1, 114 + [1, 0, "1y from 1 BCE to 1 CE"], 115 + [0, 12, "12mo from 1 BCE to 1 CE"], 116 + ], 117 + ]; 118 + 119 + for (const [one, two, yearsTest, monthsTest] of tests) { 120 + let [years, months, descr] = yearsTest; 121 + let result = one.since(two, { largestUnit: "years" }); 122 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 123 + 124 + [years, months, descr] = monthsTest; 125 + result = one.since(two, { largestUnit: "months" }); 126 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 127 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/era-boundary-roc.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "roc"; 12 + const options = { overflow: "reject" }; 13 + 14 + const broc5 = Temporal.PlainYearMonth.from({ era: "broc", eraYear: 5, monthCode: "M03", calendar }, options); 15 + const broc3 = Temporal.PlainYearMonth.from({ era: "broc", eraYear: 3, monthCode: "M01", calendar }, options); 16 + const broc1 = Temporal.PlainYearMonth.from({ era: "broc", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const roc1 = Temporal.PlainYearMonth.from({ era: "roc", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const roc5 = Temporal.PlainYearMonth.from({ era: "roc", eraYear: 5, monthCode: "M03", calendar }, options); 19 + const roc10 = Temporal.PlainYearMonth.from({ era: "roc", eraYear: 10, monthCode: "M01", calendar }, options); 20 + 21 + const tests = [ 22 + // From BROC 5 to ROC 5 23 + [ 24 + broc5, roc5, 25 + [-9, 0, "-9y backwards from BROC 5 to ROC 5 (no year 0)"], 26 + [0, -108, "-108mo backwards from BROC 5 to ROC 5 (no year 0)"], 27 + ], 28 + [ 29 + roc5, broc5, 30 + [9, 0, "9y from BROC 5 to ROC 5 (no year 0)"], 31 + [0, 108, "108mo from BROC 5 to ROC 5 (no year 0)"], 32 + ], 33 + // Era boundary 34 + [ 35 + broc1, roc1, 36 + [-1, 0, "-1y backwards from BROC 1 to ROC 1"], 37 + [0, -12, "-12mo backwards from BROC 1 to ROC 1"], 38 + ], 39 + [ 40 + roc1, broc1, 41 + [1, 0, "1y from BROC 1 to ROC 1"], 42 + [0, 12, "12mo from BROC 1 to ROC 1"], 43 + ], 44 + [ 45 + broc3, roc10, 46 + [-12, 0, "-12y backwards from BROC 3 to ROC 10"], 47 + [0, -144, "-144mo backwards from BROC 3 to ROC 10"], 48 + ], 49 + [ 50 + roc10, broc3, 51 + [12, 0, "12y from BROC 3 to ROC 10"], 52 + [0, 144, "144mo from BROC 3 to ROC 10"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.since(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.since(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+75
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/intercalary-month-coptic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations involving the intercalary month (coptic 8 + calendar) 9 + features: [Temporal, Intl.Era-monthcode] 10 + includes: [temporalHelpers.js] 11 + ---*/ 12 + 13 + const calendar = "coptic"; 14 + const options = { overflow: "reject" }; 15 + 16 + const commonM12 = Temporal.PlainYearMonth.from({ year: 1738, monthCode: "M12", calendar}, options); 17 + const commonIntercalary = Temporal.PlainYearMonth.from({ year: 1738, monthCode: "M13", calendar}, options); 18 + const leapFirst = Temporal.PlainYearMonth.from({ year: 1739, monthCode: "M01", calendar}, options); 19 + const leapM12 = Temporal.PlainYearMonth.from({ year: 1739, monthCode: "M12", calendar}, options); 20 + const leapIntercalary = Temporal.PlainYearMonth.from({ year: 1739, monthCode: "M13", calendar}, options); 21 + const common2First = Temporal.PlainYearMonth.from({ year: 1740, monthCode: "M01", calendar }, options); 22 + const common2Intercalary = Temporal.PlainYearMonth.from({ year: 1740, monthCode: "M13", calendar }, options); 23 + 24 + const tests = [ 25 + [ 26 + commonIntercalary, leapIntercalary, "backwards last month of common year to last month of leap year", 27 + ["years", -1, 0], 28 + ["months", 0, -13], 29 + ], 30 + [ 31 + leapIntercalary, common2Intercalary, "backwards last month of leap year to last month of common year", 32 + ["years", -1, 0], 33 + ["months", 0, -13], 34 + ], 35 + [ 36 + commonM12, leapFirst, "backwards 2mo passing through intercalary month in common year", 37 + ["years", 0, -2], 38 + ["months", 0, -2], 39 + ], 40 + [ 41 + leapM12, common2First, "backwards 2mo passing through intercalary month in leap year", 42 + ["years", 0, -2], 43 + ["months", 0, -2], 44 + ], 45 + [ 46 + common2Intercalary, leapIntercalary, "last month of common year to last month of leap year", 47 + ["years", 1, 0], 48 + ["months", 0, 13], 49 + ], 50 + [ 51 + leapIntercalary, commonIntercalary, "last month of leap year to last month of common year", 52 + ["years", 1, 0], 53 + ["months", 0, 13], 54 + ], 55 + [ 56 + leapFirst, commonM12, "2mo passing through intercalary month in common year", 57 + ["years", 0, 2], 58 + ["months", 0, 2], 59 + ], 60 + [ 61 + common2First, leapM12, "2mo passing through intercalary month in leap year", 62 + ["years", 0, 2], 63 + ["months", 0, 2], 64 + ], 65 + ]; 66 + 67 + for (const [one, two, descr, ...units] of tests) { 68 + for (const [largestUnit, years, months] of units) { 69 + TemporalHelpers.assertDuration( 70 + one.since(two, { largestUnit }), 71 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 72 + descr + ` (largest unit ${largestUnit})` 73 + ); 74 + } 75 + }
+75
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/intercalary-month-ethioaa.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations involving the intercalary month (ethioaa 8 + calendar) 9 + features: [Temporal, Intl.Era-monthcode] 10 + includes: [temporalHelpers.js] 11 + ---*/ 12 + 13 + const calendar = "ethioaa"; 14 + const options = { overflow: "reject" }; 15 + 16 + const commonM12 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M12", calendar}, options); 17 + const commonIntercalary = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M13", calendar}, options); 18 + const leapFirst = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M01", calendar}, options); 19 + const leapM12 = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M12", calendar}, options); 20 + const leapIntercalary = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M13", calendar}, options); 21 + const common2First = Temporal.PlainYearMonth.from({ year: 7516, monthCode: "M01", calendar }, options); 22 + const common2Intercalary = Temporal.PlainYearMonth.from({ year: 7516, monthCode: "M13", calendar }, options); 23 + 24 + const tests = [ 25 + [ 26 + commonIntercalary, leapIntercalary, "backwards last month of common year to last month of leap year", 27 + ["years", -1, 0], 28 + ["months", 0, -13], 29 + ], 30 + [ 31 + leapIntercalary, common2Intercalary, "backwards last month of leap year to last month of common year", 32 + ["years", -1, 0], 33 + ["months", 0, -13], 34 + ], 35 + [ 36 + commonM12, leapFirst, "backwards 2mo passing through intercalary month in common year", 37 + ["years", 0, -2], 38 + ["months", 0, -2], 39 + ], 40 + [ 41 + leapM12, common2First, "backwards 2mo passing through intercalary month in leap year", 42 + ["years", 0, -2], 43 + ["months", 0, -2], 44 + ], 45 + [ 46 + common2Intercalary, leapIntercalary, "last month of common year to last month of leap year", 47 + ["years", 1, 0], 48 + ["months", 0, 13], 49 + ], 50 + [ 51 + leapIntercalary, commonIntercalary, "last month of leap year to last month of common year", 52 + ["years", 1, 0], 53 + ["months", 0, 13], 54 + ], 55 + [ 56 + leapFirst, commonM12, "2mo passing through intercalary month in common year", 57 + ["years", 0, 2], 58 + ["months", 0, 2], 59 + ], 60 + [ 61 + common2First, leapM12, "2mo passing through intercalary month in leap year", 62 + ["years", 0, 2], 63 + ["months", 0, 2], 64 + ], 65 + ]; 66 + 67 + for (const [one, two, descr, ...units] of tests) { 68 + for (const [largestUnit, years, months] of units) { 69 + TemporalHelpers.assertDuration( 70 + one.since(two, { largestUnit }), 71 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 72 + descr + ` (largest unit ${largestUnit})` 73 + ); 74 + } 75 + }
+75
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/intercalary-month-ethiopic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.since 6 + description: > 7 + Check various basic calculations involving the intercalary month (ethiopic 8 + calendar) 9 + features: [Temporal, Intl.Era-monthcode] 10 + includes: [temporalHelpers.js] 11 + ---*/ 12 + 13 + const calendar = "ethiopic"; 14 + const options = { overflow: "reject" }; 15 + 16 + const commonM12 = Temporal.PlainYearMonth.from({ year: 2014, monthCode: "M12", calendar}, options); 17 + const commonIntercalary = Temporal.PlainYearMonth.from({ year: 2014, monthCode: "M13", calendar}, options); 18 + const leapFirst = Temporal.PlainYearMonth.from({ year: 2015, monthCode: "M01", calendar}, options); 19 + const leapM12 = Temporal.PlainYearMonth.from({ year: 2015, monthCode: "M12", calendar}, options); 20 + const leapIntercalary = Temporal.PlainYearMonth.from({ year: 2015, monthCode: "M13", calendar}, options); 21 + const common2First = Temporal.PlainYearMonth.from({ year: 2016, monthCode: "M01", calendar }, options); 22 + const common2Intercalary = Temporal.PlainYearMonth.from({ year: 2016, monthCode: "M13", calendar }, options); 23 + 24 + const tests = [ 25 + [ 26 + commonIntercalary, leapIntercalary, "backwards last month of common year to last month of leap year", 27 + ["years", -1, 0], 28 + ["months", 0, -13], 29 + ], 30 + [ 31 + leapIntercalary, common2Intercalary, "backwards last month of leap year to last month of common year", 32 + ["years", -1, 0], 33 + ["months", 0, -13], 34 + ], 35 + [ 36 + commonM12, leapFirst, "backwards 2mo passing through intercalary month in common year", 37 + ["years", 0, -2], 38 + ["months", 0, -2], 39 + ], 40 + [ 41 + leapM12, common2First, "backwards 2mo passing through intercalary month in leap year", 42 + ["years", 0, -2], 43 + ["months", 0, -2], 44 + ], 45 + [ 46 + common2Intercalary, leapIntercalary, "last month of common year to last month of leap year", 47 + ["years", 1, 0], 48 + ["months", 0, 13], 49 + ], 50 + [ 51 + leapIntercalary, commonIntercalary, "last month of leap year to last month of common year", 52 + ["years", 1, 0], 53 + ["months", 0, 13], 54 + ], 55 + [ 56 + leapFirst, commonM12, "2mo passing through intercalary month in common year", 57 + ["years", 0, 2], 58 + ["months", 0, 2], 59 + ], 60 + [ 61 + common2First, leapM12, "2mo passing through intercalary month in leap year", 62 + ["years", 0, 2], 63 + ["months", 0, 2], 64 + ], 65 + ]; 66 + 67 + for (const [one, two, descr, ...units] of tests) { 68 + for (const [largestUnit, years, months] of units) { 69 + TemporalHelpers.assertDuration( 70 + one.since(two, { largestUnit }), 71 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 72 + descr + ` (largest unit ${largestUnit})` 73 + ); 74 + } 75 + }
+149
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/leap-months-chinese.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + description: Difference across leap months in chinese calendar 6 + esid: sec-temporal.plainyearmonth.prototype.since 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + // 2001 is a leap year with a M04L leap month. 12 + 13 + const calendar = "chinese"; 14 + const options = { overflow: "reject" }; 15 + 16 + const common1Month4 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M04", calendar }, options); 17 + const common1Month5 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M05", calendar }, options); 18 + const common1Month6 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M06", calendar }, options); 19 + const leapMonth4 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M04", calendar }, options); 20 + const leapMonth4L = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M04L", calendar }, options); 21 + const leapMonth5 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M05", calendar }, options); 22 + const common2Month4 = Temporal.PlainYearMonth.from({ year: 2002, monthCode: "M04", calendar }, options); 23 + const common2Month5 = Temporal.PlainYearMonth.from({ year: 2002, monthCode: "M05", calendar }, options); 24 + 25 + // (receiver, argument, years test data, months test data) 26 + // test data: expected years, months, description 27 + // largestUnit years: make sure some cases where the answer is 12 months do not 28 + // balance up to 1 year 29 + // largestUnit months: similar to years, but make sure number of months in year 30 + // is computed correctly 31 + const tests = [ 32 + [ 33 + common1Month4, leapMonth4, 34 + [-1, 0, "M04-M04 common-leap backwards is -1y"], 35 + [0, -12, "M04-M04 common-leap backwards is -12mo"], 36 + ], 37 + [ 38 + leapMonth4, common2Month4, 39 + [-1, 0, "M04-M04 leap-common backwards is -1y"], 40 + [0, -13, "M04-M04 leap-common backwards is -13mo not -12mo"], 41 + ], 42 + [ 43 + common1Month4, common2Month4, 44 + [-2, 0, "M04-M04 common-common backwards is -2y"], 45 + [0, -25, "M04-M04 common-common backwards is -25mo not -24mo"], 46 + ], 47 + [ 48 + common1Month5, leapMonth5, 49 + [-1, 0, "M05-M05 common-leap backwards is -1y"], 50 + [0, -13, "M05-M05 common-leap backwards is -13mo not -12mo"], 51 + ], 52 + [ 53 + leapMonth5, common2Month5, 54 + [-1, 0, "M05-M05 leap-common backwards is -1y"], 55 + [0, -12, "M05-M05 leap-common backwards is -12mo"], 56 + ], 57 + [ 58 + common1Month5, common2Month5, 59 + [-2, 0, "M05-M05 common-common backwards is -2y"], 60 + [0, -25, "M05-M05 common-common backwards is -25mo not -24mo"], 61 + ], 62 + [ 63 + common1Month4, leapMonth4L, 64 + [-1, -1, "M04-M04L backwards is -1y -1mo"], 65 + [0, -13, "M04-M04L backwards is -13mo"], 66 + ], 67 + [ 68 + leapMonth4L, common2Month4, 69 + [0, -12, "M04L-M04 backwards is -12mo not -1y"], 70 + [0, -12, "M04L-M04 backwards is -12mo"], 71 + ], 72 + [ 73 + common1Month5, leapMonth4L, 74 + [0, -12, "M05-M04L backwards is -12mo not -1y"], 75 + [0, -12, "M05-M04L backwards is -12mo"], 76 + ], 77 + [ 78 + leapMonth4L, common2Month5, 79 + [-1, -1, "M04L-M05 backwards is -1y -1mo (exhibits calendar-specific constraining)"], 80 + [0, -13, "M04L-M05 backwards is -13mo"], 81 + ], 82 + [ 83 + common1Month6, leapMonth5, 84 + [0, -12, "M06-M05 common-leap backwards is -12mo not -11mo"], 85 + [0, -12, "M06-M05 common-leap backwards is -12mo not -11mo"], 86 + ], 87 + 88 + // Negative 89 + [ 90 + common2Month4, leapMonth4, 91 + [1, 0, "M04-M04 common-leap is 1y"], 92 + [0, 13, "M04-M04 common-leap is 13mo not 12mo"], 93 + ], 94 + [ 95 + leapMonth4, common1Month4, 96 + [1, 0, "M04-M04 leap-common is 1y"], 97 + [0, 12, "M04-M04 leap-common is 12mo not 13mo"], 98 + ], 99 + [ 100 + common2Month4, common1Month4, 101 + [2, 0, "M04-M04 common-common is 2y"], 102 + [0, 25, "M04-M04 common-common is 25mo not 24mo"], 103 + ], 104 + [ 105 + common2Month5, leapMonth5, 106 + [1, 0, "M05-M05 common-leap is 1y"], 107 + [0, 12, "M05-M05 common-leap is 12mo not 13mo"], 108 + ], 109 + [ 110 + leapMonth5, common1Month5, 111 + [1, 0, "M05-M05 leap-common is 1y"], 112 + [0, 13, "M05-M05 leap-common is 13mo not 12mo"], 113 + ], 114 + [ 115 + common2Month5, common1Month5, 116 + [2, 0, "M05-M05 common-common is 2y"], 117 + [0, 25, "M05-M05 common-common is 25mo not 24mo"], 118 + ], 119 + [ 120 + common2Month4, leapMonth4L, 121 + [0, 12, "M04-M04L is 12mo not 1y"], 122 + [0, 12, "M04-M04L is 12mo"], 123 + ], 124 + [ 125 + leapMonth4L, common1Month4, 126 + [1, 0, "M04L-M04 is 1y not 1y 1mo (exhibits calendar-specific constraining)"], 127 + [0, 13, "M04L-M04 is 13mo"], 128 + ], 129 + [ 130 + common2Month5, leapMonth4L, 131 + [1, 1, "M05-M04L is 1y 1mo"], 132 + [0, 13, "M05-M04L is 13mo"], 133 + ], 134 + [ 135 + leapMonth4L, common1Month5, 136 + [0, 12, "M04L-M05 is 12mo not 1y"], 137 + [0, 12, "M04L-M05 is 12mo"], 138 + ], 139 + ]; 140 + 141 + for (const [one, two, yearsTest, monthsTest] of tests) { 142 + let [years, months, descr] = yearsTest; 143 + let result = one.since(two, { largestUnit: "years" }); 144 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 145 + 146 + [years, months, descr] = monthsTest; 147 + result = one.since(two, { largestUnit: "months" }); 148 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 149 + }
+149
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/leap-months-dangi.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + description: Difference across leap months in dangi calendar 6 + esid: sec-temporal.plainyearmonth.prototype.since 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + // 2001 is a leap year with a M04L leap month. 12 + 13 + const calendar = "dangi"; 14 + const options = { overflow: "reject" }; 15 + 16 + const common1Month4 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M04", calendar }, options); 17 + const common1Month5 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M05", calendar }, options); 18 + const common1Month6 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M06", calendar }, options); 19 + const leapMonth4 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M04", calendar }, options); 20 + const leapMonth4L = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M04L", calendar }, options); 21 + const leapMonth5 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M05", calendar }, options); 22 + const common2Month4 = Temporal.PlainYearMonth.from({ year: 2002, monthCode: "M04", calendar }, options); 23 + const common2Month5 = Temporal.PlainYearMonth.from({ year: 2002, monthCode: "M05", calendar }, options); 24 + 25 + // (receiver, argument, years test data, months test data) 26 + // test data: expected years, months, description 27 + // largestUnit years: make sure some cases where the answer is 12 months do not 28 + // balance up to 1 year 29 + // largestUnit months: similar to years, but make sure number of months in year 30 + // is computed correctly 31 + const tests = [ 32 + [ 33 + common1Month4, leapMonth4, 34 + [-1, 0, "M04-M04 common-leap backwards is -1y"], 35 + [0, -12, "M04-M04 common-leap backwards is -12mo"], 36 + ], 37 + [ 38 + leapMonth4, common2Month4, 39 + [-1, 0, "M04-M04 leap-common backwards is -1y"], 40 + [0, -13, "M04-M04 leap-common backwards is -13mo not -12mo"], 41 + ], 42 + [ 43 + common1Month4, common2Month4, 44 + [-2, 0, "M04-M04 common-common backwards is -2y"], 45 + [0, -25, "M04-M04 common-common backwards is -25mo not -24mo"], 46 + ], 47 + [ 48 + common1Month5, leapMonth5, 49 + [-1, 0, "M05-M05 common-leap backwards is -1y"], 50 + [0, -13, "M05-M05 common-leap backwards is -13mo not -12mo"], 51 + ], 52 + [ 53 + leapMonth5, common2Month5, 54 + [-1, 0, "M05-M05 leap-common backwards is -1y"], 55 + [0, -12, "M05-M05 leap-common backwards is -12mo"], 56 + ], 57 + [ 58 + common1Month5, common2Month5, 59 + [-2, 0, "M05-M05 common-common backwards is -2y"], 60 + [0, -25, "M05-M05 common-common backwards is -25mo not -24mo"], 61 + ], 62 + [ 63 + common1Month4, leapMonth4L, 64 + [-1, -1, "M04-M04L backwards is -1y -1mo"], 65 + [0, -13, "M04-M04L backwards is -13mo"], 66 + ], 67 + [ 68 + leapMonth4L, common2Month4, 69 + [0, -12, "M04L-M04 backwards is -12mo not -1y"], 70 + [0, -12, "M04L-M04 backwards is -12mo"], 71 + ], 72 + [ 73 + common1Month5, leapMonth4L, 74 + [0, -12, "M05-M04L backwards is -12mo not -1y"], 75 + [0, -12, "M05-M04L backwards is -12mo"], 76 + ], 77 + [ 78 + leapMonth4L, common2Month5, 79 + [-1, -1, "M04L-M05 backwards is -1y -1mo (exhibits calendar-specific constraining)"], 80 + [0, -13, "M04L-M05 backwards is -13mo"], 81 + ], 82 + [ 83 + common1Month6, leapMonth5, 84 + [0, -12, "M06-M05 common-leap backwards is -12mo not -11mo"], 85 + [0, -12, "M06-M05 common-leap backwards is -12mo not -11mo"], 86 + ], 87 + 88 + // Negative 89 + [ 90 + common2Month4, leapMonth4, 91 + [1, 0, "M04-M04 common-leap is 1y"], 92 + [0, 13, "M04-M04 common-leap is 13mo not 12mo"], 93 + ], 94 + [ 95 + leapMonth4, common1Month4, 96 + [1, 0, "M04-M04 leap-common is 1y"], 97 + [0, 12, "M04-M04 leap-common is 12mo not 13mo"], 98 + ], 99 + [ 100 + common2Month4, common1Month4, 101 + [2, 0, "M04-M04 common-common is 2y"], 102 + [0, 25, "M04-M04 common-common is 25mo not 24mo"], 103 + ], 104 + [ 105 + common2Month5, leapMonth5, 106 + [1, 0, "M05-M05 common-leap is 1y"], 107 + [0, 12, "M05-M05 common-leap is 12mo not 13mo"], 108 + ], 109 + [ 110 + leapMonth5, common1Month5, 111 + [1, 0, "M05-M05 leap-common is 1y"], 112 + [0, 13, "M05-M05 leap-common is 13mo not 12mo"], 113 + ], 114 + [ 115 + common2Month5, common1Month5, 116 + [2, 0, "M05-M05 common-common is 2y"], 117 + [0, 25, "M05-M05 common-common is 25mo not 24mo"], 118 + ], 119 + [ 120 + common2Month4, leapMonth4L, 121 + [0, 12, "M04-M04L is 12mo not 1y"], 122 + [0, 12, "M04-M04L is 12mo"], 123 + ], 124 + [ 125 + leapMonth4L, common1Month4, 126 + [1, 0, "M04L-M04 is 1y not 1y 1mo (exhibits calendar-specific constraining)"], 127 + [0, 13, "M04L-M04 is 13mo"], 128 + ], 129 + [ 130 + common2Month5, leapMonth4L, 131 + [1, 1, "M05-M04L is 1y 1mo"], 132 + [0, 13, "M05-M04L is 13mo"], 133 + ], 134 + [ 135 + leapMonth4L, common1Month5, 136 + [0, 12, "M04L-M05 is 12mo not 1y"], 137 + [0, 12, "M04L-M05 is 12mo"], 138 + ], 139 + ]; 140 + 141 + for (const [one, two, yearsTest, monthsTest] of tests) { 142 + let [years, months, descr] = yearsTest; 143 + let result = one.since(two, { largestUnit: "years" }); 144 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 145 + 146 + [years, months, descr] = monthsTest; 147 + result = one.since(two, { largestUnit: "months" }); 148 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 149 + }
+153
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/since/leap-months-hebrew.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + description: Difference across leap months in hebrew calendar 6 + esid: sec-temporal.plainyearmonth.prototype.since 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + // 5784 is a leap year. 12 + // M05 - Shevat 13 + // M05L - Adar I 14 + // M06 - Adar II 15 + // M07 - Nisan 16 + 17 + const calendar = "hebrew"; 18 + const options = { overflow: "reject" }; 19 + 20 + const common1Shevat = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M05", calendar }, options); 21 + const common1Adar = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M06", calendar }, options); 22 + const common1Nisan = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M07", calendar }, options); 23 + const leapShevat = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M05", calendar }, options); 24 + const leapAdarI = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M05L", calendar }, options); 25 + const leapAdarII = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M06", calendar }, options); 26 + const common2Shevat = Temporal.PlainYearMonth.from({ year: 5785, monthCode: "M05", calendar }, options); 27 + const common2Adar = Temporal.PlainYearMonth.from({ year: 5785, monthCode: "M06", calendar }, options); 28 + 29 + // (receiver, argument, years test data, months test data) 30 + // test data: expected years, months, description 31 + // largestUnit years: make sure some cases where the answer is 12 months do not 32 + // balance up to 1 year 33 + // largestUnit months: similar to years, but make sure number of months in year 34 + // is computed correctly 35 + const tests = [ 36 + [ 37 + common1Shevat, leapShevat, 38 + [-1, 0, "M05-M05 common-leap backwards is -1y"], 39 + [0, -12, "M05-M05 common-leap backwards is -12mo"], 40 + ], 41 + [ 42 + leapShevat, common2Shevat, 43 + [-1, 0, "M05-M05 leap-common backwards is -1y"], 44 + [0, -13, "M05-M05 leap-common backwards is -13mo not -12mo"], 45 + ], 46 + [ 47 + common1Shevat, common2Shevat, 48 + [-2, 0, "M05-M05 common-common backwards is -2y"], 49 + [0, -25, "M05-M05 common-common backwards is -25mo not -24mo"], 50 + ], 51 + [ 52 + common1Adar, leapAdarII, 53 + [-1, 0, "M06-M06 common-leap backwards is -1y"], 54 + [0, -13, "M06-M06 common-leap backwards is -13mo not -12mo"], 55 + ], 56 + [ 57 + leapAdarII, common2Adar, 58 + [-1, 0, "M06-M06 leap-common backwards is -1y"], 59 + [0, -12, "M06-M06 leap-common backwards is -12mo"], 60 + ], 61 + [ 62 + common1Adar, common2Adar, 63 + [-2, 0, "M06-M06 common-common backwards is -2y"], 64 + [0, -25, "M06-M06 common-common backwards is -25mo not -24mo"], 65 + ], 66 + [ 67 + common1Shevat, leapAdarI, 68 + [-1, -1, "M05-M05L backwards is -1y -1mo"], 69 + [0, -13, "M05-M05L backwards is -13mo"], 70 + ], 71 + [ 72 + leapAdarI, common2Shevat, 73 + [0, -12, "M05L-M05 backwards is -12mo not -1y"], 74 + [0, -12, "M05L-M05 backwards is -12mo"], 75 + ], 76 + [ 77 + common1Adar, leapAdarI, 78 + [0, -12, "M06-M05L backwards is -12mo not -1y"], 79 + [0, -12, "M06-M05L backwards is -12mo"], 80 + ], 81 + [ 82 + leapAdarI, common2Adar, 83 + [-1, 0, "M05L-M06 backwards is -1y (exhibits calendar-specific constraining)"], 84 + [0, -13, "M05L-M06 backwards is -13mo"], 85 + ], 86 + [ 87 + common1Nisan, leapAdarII, 88 + [0, -12, "M07-M06 common-leap backwards is -12mo not -11mo"], 89 + [0, -12, "M07-M06 common-leap backwards is -12mo not -11mo"], 90 + ], 91 + 92 + // Negative 93 + [ 94 + common2Shevat, leapShevat, 95 + [1, 0, "M05-M05 common-leap is 1y"], 96 + [0, 13, "M05-M05 common-leap is 13mo not 12mo"], 97 + ], 98 + [ 99 + leapShevat, common1Shevat, 100 + [1, 0, "M05-M05 leap-common is 1y"], 101 + [0, 12, "M05-M05 leap-common is 12mo not 13mo"], 102 + ], 103 + [ 104 + common2Shevat, common1Shevat, 105 + [2, 0, "M05-M05 common-common is 2y"], 106 + [0, 25, "M05-M05 common-common is 25mo not 24mo"], 107 + ], 108 + [ 109 + common2Adar, leapAdarII, 110 + [1, 0, "M06-M06 common-leap is 1y"], 111 + [0, 12, "M06-M06 common-leap is 12mo not 13mo"], 112 + ], 113 + [ 114 + leapAdarII, common1Adar, 115 + [1, 0, "M06-M06 leap-common is 1y"], 116 + [0, 13, "M06-M06 leap-common is 13mo not 12mo"], 117 + ], 118 + [ 119 + common2Adar, common1Adar, 120 + [2, 0, "M06-M06 common-common is 2y"], 121 + [0, 25, "M06-M06 common-common is 25mo not 24mo"], 122 + ], 123 + [ 124 + common2Shevat, leapAdarI, 125 + [0, 12, "M05-M05L is 12mo not 1y"], 126 + [0, 12, "M05-M05L is 12mo"], 127 + ], 128 + [ 129 + leapAdarI, common1Shevat, 130 + [1, 1, "M05L-M05 is 1y 1mo (exhibits calendar-specific constraining)"], 131 + [0, 13, "M05L-M05 is 13mo"], 132 + ], 133 + [ 134 + common2Adar, leapAdarI, 135 + [1, 1, "M06-M05L is 1y 1mo"], 136 + [0, 13, "M06-M05L is 13mo"], 137 + ], 138 + [ 139 + leapAdarI, common1Adar, 140 + [0, 12, "M05L-M06 is 12mo not 1y"], 141 + [0, 12, "M05L-M06 is 12mo"], 142 + ], 143 + ]; 144 + 145 + for (const [one, two, yearsTest, monthsTest] of tests) { 146 + let [years, months, descr] = yearsTest; 147 + let result = one.since(two, { largestUnit: "years" }); 148 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 149 + 150 + [years, months, descr] = monthsTest; 151 + result = one.since(two, { largestUnit: "months" }); 152 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 153 + }
+213
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-buddhist.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (buddhist calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "buddhist"; 14 + 15 + // Years 16 + 17 + const date250302 = Temporal.PlainYearMonth.from({ year: 2503, monthCode: "M02", calendar }); 18 + const date250303 = Temporal.PlainYearMonth.from({ year: 2503, monthCode: "M03", calendar }); 19 + const date251207 = Temporal.PlainYearMonth.from({ year: 2512, monthCode: "M07", calendar }); 20 + const date254007 = Temporal.PlainYearMonth.from({ year: 2540, monthCode: "M07", calendar }); 21 + const date254012 = Temporal.PlainYearMonth.from({ year: 2540, monthCode: "M12", calendar }); 22 + const date255512 = Temporal.PlainYearMonth.from({ year: 2555, monthCode: "M12", calendar }); 23 + const date255606 = Temporal.PlainYearMonth.from({ year: 2556, monthCode: "M06", calendar }); 24 + const date255906 = Temporal.PlainYearMonth.from({ year: 2559, monthCode: "M06", calendar }); 25 + const date256207 = Temporal.PlainYearMonth.from({ year: 2562, monthCode: "M07", calendar }); 26 + const date256212 = Temporal.PlainYearMonth.from({ year: 2562, monthCode: "M12", calendar }); 27 + const date256303 = Temporal.PlainYearMonth.from({ year: 2563, monthCode: "M03", calendar }); 28 + const date256312 = Temporal.PlainYearMonth.from({ year: 2563, monthCode: "M12", calendar }); 29 + const date256401 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M01", calendar }); 30 + const date256403 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M03", calendar }); 31 + const date256407 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M07", calendar }); 32 + const date256408 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M08", calendar }); 33 + const date256409 = Temporal.PlainYearMonth.from({ year: 2564, monthCode: "M09", calendar }); 34 + const date256507 = Temporal.PlainYearMonth.from({ year: 2565, monthCode: "M07", calendar }); 35 + const date256509 = Temporal.PlainYearMonth.from({ year: 2565, monthCode: "M09", calendar }); 36 + const date257407 = Temporal.PlainYearMonth.from({ year: 2574, monthCode: "M07", calendar }); 37 + const date257412 = Temporal.PlainYearMonth.from({ year: 2574, monthCode: "M12", calendar }); 38 + 39 + const tests = [ 40 + [ 41 + date256407, date256407, "same day", 42 + ["years", 0, 0], 43 + ["months", 0, 0], 44 + ], 45 + [ 46 + date256407, date256408, "1 month in same year", 47 + ["years", 0, 1], 48 + ["months", 0, 1], 49 + ], 50 + [ 51 + date256312, date256401, "1 month in different year", 52 + ["years", 0, 1], 53 + ["months", 0, 1], 54 + ], 55 + [ 56 + date256407, date256409, "2 months which both have 31 days", 57 + ["years", 0, 2], 58 + ["months", 0, 2], 59 + ], 60 + [ 61 + date256407, date256507, "1 year", 62 + ["years", 1, 0], 63 + ["months", 0, 12], 64 + ], 65 + [ 66 + date256407, date257407, "10 years", 67 + ["years", 10, 0], 68 + ["months", 0, 120], 69 + ], 70 + [ 71 + date256407, date256509, "1 year 2 months", 72 + ["years", 1, 2], 73 + ], 74 + [ 75 + date256407, date257412, "10 years and 5 months", 76 + ["years", 10, 5], 77 + ], 78 + [ 79 + date254012, date256407, "23 years and 7 months", 80 + ["years", 23, 7], 81 + ], 82 + [ 83 + date254007, date256407, "24 years", 84 + ["years", 24, 0], 85 + ], 86 + [ 87 + date250302, date256303, "60 years, 1 month", 88 + ["years", 60, 1], 89 + ], 90 + [ 91 + date256403, date256407, "4 months", 92 + ["years", 0, 4], 93 + ], 94 + [ 95 + date256303, date256407, "1 year, 4 months", 96 + ["years", 1, 4], 97 + ], 98 + [ 99 + date250303, date256407, "61 years, 4 months", 100 + ["years", 61, 4], 101 + ], 102 + [ 103 + date256212, date256407, "1 year, 7 months", 104 + ["years", 1, 7], 105 + ], 106 + [ 107 + date255512, date255606, "6 months", 108 + ["months", 0, 6], 109 + ], 110 + [ 111 + date254012, date256407, "23 years, 7 months", 112 + ["years", 23, 7], 113 + ], 114 + [ 115 + date256212, date256403, "1 year, 3 months", 116 + ["years", 1, 3], 117 + ], 118 + [ 119 + date255512, date255906, "3 years, 6 months", 120 + ["years", 3, 6], 121 + ], 122 + [ 123 + date251207, date256207, "crossing epoch", 124 + ["years", 50, 0], 125 + ], 126 + [ 127 + date256408, date256407, "negative 1 month in same year", 128 + ["years", 0, -1], 129 + ["months", 0, -1], 130 + ], 131 + [ 132 + date256401, date256312, "negative 1 month in different year", 133 + ["years", 0, -1], 134 + ["months", 0, -1], 135 + ], 136 + [ 137 + date256409, date256407, "negative 2 months which both have 31 days", 138 + ["years", 0, -2], 139 + ["months", 0, -2], 140 + ], 141 + [ 142 + date256507, date256407, "negative 1 year", 143 + ["years", -1, 0], 144 + ["months", 0, -12], 145 + ], 146 + [ 147 + date257407, date256407, "negative 10 years", 148 + ["years", -10, 0], 149 + ["months", 0, -120], 150 + ], 151 + [ 152 + date256509, date256407, "negative 1 year 2 months", 153 + ["years", -1, -2], 154 + ], 155 + [ 156 + date257412, date256407, "negative 10 years and 5 months", 157 + ["years", -10, -5], 158 + ], 159 + [ 160 + date256407, date254012, "negative 23 years and 7 months", 161 + ["years", -23, -7], 162 + ], 163 + [ 164 + date256407, date254007, "negative 24 years", 165 + ["years", -24, 0], 166 + ], 167 + [ 168 + date256303, date250302, "negative 60 years, 1 month", 169 + ["years", -60, -1], 170 + ], 171 + [ 172 + date256407, date256403, "negative 4 months", 173 + ["years", 0, -4], 174 + ], 175 + [ 176 + date256407, date256303, "negative 1 year, 4 months", 177 + ["years", -1, -4], 178 + ], 179 + [ 180 + date256407, date250303, "negative 61 years, 4 months", 181 + ["years", -61, -4], 182 + ], 183 + [ 184 + date256407, date256212, "negative 1 year, 7 months", 185 + ["years", -1, -7], 186 + ], 187 + [ 188 + date256407, date256312, "negative 7 months", 189 + ["years", 0, -7], 190 + ], 191 + [ 192 + date256407, date254012, "negative 23 years, 7 months", 193 + ["years", -23, -7], 194 + ], 195 + [ 196 + date256403, date256212, "negative 1 year, 3 months", 197 + ["years", -1, -3], 198 + ], 199 + [ 200 + date256207, date251207, "crossing epoch", 201 + ["years", -50, 0], 202 + ], 203 + ]; 204 + 205 + for (const [one, two, descr, ...units] of tests) { 206 + for (const [largestUnit, years, months] of units) { 207 + TemporalHelpers.assertDuration( 208 + one.until(two, { largestUnit }), 209 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 210 + descr 211 + ); 212 + } 213 + }
+206
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-chinese.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (chinese calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "chinese"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196103 = Temporal.PlainYearMonth.from({ year: 1961, monthCode: "M03", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 23 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 24 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 25 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 26 + const date202102 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M02", calendar }); 27 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar }); 28 + const date202104 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M04", calendar }); 29 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 30 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 31 + const date202109 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M09", calendar }); 32 + const date202112 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M12", calendar }); 33 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 34 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 35 + const date202307 = Temporal.PlainYearMonth.from({ year: 2023, monthCode: "M07", calendar }); 36 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 37 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 38 + 39 + const tests = [ 40 + [ 41 + date202107, date202107, "same day", 42 + ["years", 0, 0], 43 + ["months", 0, 0], 44 + ], 45 + [ 46 + date202107, date202108, "1 month in same year (30-day month to 29-day month)", 47 + ["years", 0, 1], 48 + ["months", 0, 1], 49 + ], 50 + [ 51 + date202012, date202101, "1 month in different year", 52 + ["years", 0, 1], 53 + ["months", 0, 1], 54 + ], 55 + [ 56 + date202101, date202102, "1 month in same year (29-day month to 30-day month)", 57 + ["years", 0, 1], 58 + ["months", 0, 1], 59 + ], 60 + [ 61 + date202107, date202109, "2 months which both have 30 days", 62 + ["years", 0, 2], 63 + ["months", 0, 2], 64 + ], 65 + [ 66 + date202107, date202207, "1 year", 67 + ["years", 1, 0], 68 + ["months", 0, 12], 69 + ], 70 + [ 71 + date202107, date203107, "10 years", 72 + ["years", 10, 0], 73 + ["months", 0, 124], 74 + ], 75 + [ 76 + date202107, date202209, "1 year 2 months", 77 + ["years", 1, 2], 78 + ], 79 + [ 80 + date202107, date203112, "10 years and 5 months", 81 + ["years", 10, 5], 82 + ], 83 + [ 84 + date199712, date202107, "23 years and 7 months", 85 + ["years", 23, 7], 86 + ], 87 + [ 88 + date199707, date202107, "24 years", 89 + ["years", 24, 0], 90 + ], 91 + [ 92 + date196002, date202003, "60 years, 1 month", 93 + ["years", 60, 1], 94 + ], 95 + [ 96 + date202103, date202107, "4 months", 97 + ["years", 0, 4], 98 + ], 99 + [ 100 + date202003, date202107, "1 year, 4 months", 101 + ["years", 1, 4], 102 + ], 103 + [ 104 + date196003, date202107, "61 years, 4 months", 105 + ["years", 61, 4], 106 + ], 107 + [ 108 + date201912, date202107, "1 year, 7 months", 109 + ["years", 1, 7], 110 + ], 111 + [ 112 + date202012, date202107, "7 months", 113 + ["years", 0, 7], 114 + ], 115 + [ 116 + date199712, date202107, "23 years, 7 months", 117 + ["years", 23, 7], 118 + ], 119 + [ 120 + date201912, date202103, "1 year, 3 months", 121 + ["years", 1, 3], 122 + ], 123 + [ 124 + date202108, date202107, "negative 1 month in same year", 125 + ["years", 0, -1], 126 + ["months", 0, -1], 127 + ], 128 + [ 129 + date202101, date202012, "negative 1 month in different year", 130 + ["years", 0, -1], 131 + ["months", 0, -1], 132 + ], 133 + [ 134 + date202104, date202102, "negative 2 months which both have 30 days", 135 + ["years", 0, -2], 136 + ["months", 0, -2], 137 + ], 138 + [ 139 + date202207, date202107, "negative 1 year", 140 + ["years", -1, 0], 141 + ["months", 0, -12], 142 + ], 143 + [ 144 + date203107, date202107, "negative 10 years", 145 + ["years", -10, 0], 146 + ["months", 0, -124], 147 + ], 148 + [ 149 + date202209, date202107, "negative 1 year 2 months", 150 + ["years", -1, -2], 151 + ], 152 + [ 153 + date203112, date202107, "negative 10 years and 5 months", 154 + ["years", -10, -5], 155 + ], 156 + [ 157 + date202107, date199712, "negative 23 years and 8 months", 158 + ["years", -23, -8], 159 + ], 160 + [ 161 + date202107, date199707, "negative 24 years", 162 + ["years", -24, 0], 163 + ], 164 + [ 165 + date202003, date196002, "negative 60 years, 1 month", 166 + ["years", -60, -1], 167 + ], 168 + [ 169 + date202107, date202103, "negative 4 months", 170 + ["years", 0, -4], 171 + ], 172 + [ 173 + date202207, date202103, "negative 1 year, 4 months", 174 + ["years", -1, -4], 175 + ], 176 + [ 177 + date202207, date196103, "negative 61 years, 4 months", 178 + ["years", -61, -4], 179 + ], 180 + [ 181 + date202307, date202112, "negative 1 year, 7 months", 182 + ["years", -1, -7], 183 + ], 184 + [ 185 + date202107, date202012, "negative 7 months", 186 + ["years", 0, -7], 187 + ], 188 + [ 189 + date202107, date199712, "negative 23 years, 8 months", 190 + ["years", -23, -8], 191 + ], 192 + [ 193 + date202103, date201912, "negative 1 year, 3 months", 194 + ["years", -1, -3], 195 + ] 196 + ]; 197 + 198 + for (const [one, two, descr, ...units] of tests) { 199 + for (const [largestUnit, years, months] of units) { 200 + TemporalHelpers.assertDuration( 201 + one.until(two, { largestUnit }), 202 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 203 + `${descr} (largestUnit = ${largestUnit})` 204 + ); 205 + } 206 + }
+215
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-coptic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (coptic calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "coptic"; 14 + 15 + // Years 16 + 17 + const date171002 = Temporal.PlainYearMonth.from({ year: 1710, monthCode: "M02", calendar }); 18 + const date171003 = Temporal.PlainYearMonth.from({ year: 1710, monthCode: "M03", calendar }); 19 + const date171103 = Temporal.PlainYearMonth.from({ year: 1711, monthCode: "M03", calendar }); 20 + const date171312 = Temporal.PlainYearMonth.from({ year: 1713, monthCode: "M12", calendar }); 21 + const date171612 = Temporal.PlainYearMonth.from({ year: 1716, monthCode: "M12", calendar }); 22 + const date171705 = Temporal.PlainYearMonth.from({ year: 1717, monthCode: "M05", calendar }); 23 + const date174707 = Temporal.PlainYearMonth.from({ year: 1747, monthCode: "M07", calendar }); 24 + const date174712 = Temporal.PlainYearMonth.from({ year: 1747, monthCode: "M12", calendar }); 25 + const date174713 = Temporal.PlainYearMonth.from({ year: 1747, monthCode: "M13", calendar }); 26 + const date176912 = Temporal.PlainYearMonth.from({ year: 1769, monthCode: "M12", calendar }); 27 + const date176913 = Temporal.PlainYearMonth.from({ year: 1769, monthCode: "M13", calendar }); 28 + const date177003 = Temporal.PlainYearMonth.from({ year: 1770, monthCode: "M03", calendar }); 29 + const date177012 = Temporal.PlainYearMonth.from({ year: 1770, monthCode: "M12", calendar }); 30 + const date177013 = Temporal.PlainYearMonth.from({ year: 1770, monthCode: "M13", calendar }); 31 + const date177101 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M01", calendar }); 32 + const date177102 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M02", calendar }); 33 + const date177103 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M03", calendar });; 34 + const date177104 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M04", calendar }); 35 + const date177106 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M06", calendar }); 36 + const date177107 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M07", calendar }); 37 + const date177108 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M08", calendar }); 38 + const date177112 = Temporal.PlainYearMonth.from({ year: 1771, monthCode: "M12", calendar }); 39 + const date177207 = Temporal.PlainYearMonth.from({ year: 1772, monthCode: "M07", calendar }); 40 + const date177209 = Temporal.PlainYearMonth.from({ year: 1772, monthCode: "M09", calendar }); 41 + const date177307 = Temporal.PlainYearMonth.from({ year: 1773, monthCode: "M07", calendar }); 42 + const date178107 = Temporal.PlainYearMonth.from({ year: 1781, monthCode: "M07", calendar }); 43 + const date178112 = Temporal.PlainYearMonth.from({ year: 1781, monthCode: "M12", calendar }); 44 + 45 + const tests = [ 46 + [ 47 + date177107, date177107, "same day", 48 + ["years", 0, 0], 49 + ["months", 0, 0], 50 + ], 51 + [ 52 + date177107, date177108, "1 month in same year (30-day month to 29-day month)", 53 + ["years", 0, 1], 54 + ["months", 0, 1], 55 + ], 56 + [ 57 + date177013, date177101, "1 month in different year", 58 + ["years", 0, 1], 59 + ["months", 0, 1], 60 + ], 61 + [ 62 + date177101, date177102, "1 month in same year (29-day month to 30-day month)", 63 + ["years", 0, 1], 64 + ["months", 0, 1], 65 + ], 66 + [ 67 + date171612, date171705, "6 months in different year", 68 + ["months", 0, 6], 69 + ], 70 + [ 71 + date177207, date177307, "1 year", 72 + ["years", 1, 0], 73 + ["months", 0, 13], 74 + ], 75 + [ 76 + date177107, date178107, "10 years", 77 + ["years", 10, 0], 78 + ["months", 0, 130], 79 + ], 80 + [ 81 + date177107, date177209, "1 year 2 months", 82 + ["years", 1, 2], 83 + ], 84 + [ 85 + date171312, date171705, "3 years, 6 months", 86 + ["years", 3, 6], 87 + ], 88 + [ 89 + date177107, date178112, "10 years and 5 months", 90 + ["years", 10, 5], 91 + ], 92 + [ 93 + date174712, date177106, "23 years and 7 months", 94 + ["years", 23, 7], 95 + ], 96 + [ 97 + date174707, date177107, "24 years", 98 + ["years", 24, 0], 99 + ], 100 + [ 101 + date174707, date177106, "23 years, 12 months", 102 + ["years", 23, 12], 103 + ], 104 + [ 105 + date171002, date177003, "60 years, 1 month", 106 + ["years", 60, 1], 107 + ], 108 + [ 109 + date177103, date177107, "4 months", 110 + ["years", 0, 4], 111 + ], 112 + [ 113 + date177003, date177107, "1 year, 4 months", 114 + ["years", 1, 4], 115 + ], 116 + [ 117 + date171003, date177107, "61 years, 4 months", 118 + ["years", 61, 4], 119 + ], 120 + [ 121 + date176912, date177107, "1 year, 8 months", 122 + ["years", 1, 8], 123 + ], 124 + [ 125 + date177013, date177106, "6 months", 126 + ["years", 0, 6], 127 + ], 128 + [ 129 + date174713, date177106, "23 years, 6 months", 130 + ["years", 23, 6], 131 + ], 132 + [ 133 + date176913, date177102, "1 year, 2 months", 134 + ["years", 1, 2], 135 + ], 136 + [ 137 + date177108, date177107, "negative 1 month in same year", 138 + ["years", 0, -1], 139 + ["months", 0, -1], 140 + ], 141 + [ 142 + date177101, date177013, "negative 1 month in different year", 143 + ["years", 0, -1], 144 + ["months", 0, -1], 145 + ], 146 + [ 147 + date177104, date177102, "negative 2 months which both have 30 days", 148 + ["years", 0, -2], 149 + ["months", 0, -2], 150 + ], 151 + [ 152 + date177307, date177207, "negative 1 year", 153 + ["years", -1, 0], 154 + ["months", 0, -13], 155 + ], 156 + [ 157 + date178107, date177107, "negative 10 years", 158 + ["years", -10, 0], 159 + ["months", 0, -130], 160 + ], 161 + [ 162 + date177209, date177107, "negative 1 year 2 months", 163 + ["years", -1, -2], 164 + ], 165 + [ 166 + date178112, date177107, "negative 10 years and 5 months", 167 + ["years", -10, -5], 168 + ], 169 + [ 170 + date177107, date174712, "negative 23 years and 8 months", 171 + ["years", -23, -8], 172 + ], 173 + [ 174 + date177107, date174707, "negative 24 years", 175 + ["years", -24, 0], 176 + ], 177 + [ 178 + date177003, date171002, "negative 60 years, 1 month", 179 + ["years", -60, -1], 180 + ], 181 + [ 182 + date177107, date177103, "negative 4 months", 183 + ["years", 0, -4], 184 + ], 185 + [ 186 + date177207, date177103, "negative 1 year, 4 months", 187 + ["years", -1, -4], 188 + ], 189 + [ 190 + date177207, date171103, "negative 61 years, 4 months", 191 + ["years", -61, -4], 192 + ], 193 + [ 194 + date177307, date177112, "negative 1 year, 8 months", 195 + ["years", -1, -8], 196 + ], 197 + [ 198 + date177107, date177012, "negative 8 months", 199 + ["years", 0, -8], 200 + ], 201 + [ 202 + date177107, date174712, "negative 23 years, 8 months", 203 + ["years", -23, -8], 204 + ], 205 + ]; 206 + 207 + for (const [one, two, descr, ...units] of tests) { 208 + for (const [largestUnit, years, months] of units) { 209 + TemporalHelpers.assertDuration( 210 + one.until(two, { largestUnit }), 211 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 212 + `${descr} (largestUnit = ${largestUnit})` 213 + ); 214 + } 215 + }
+206
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-dangi.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (dangi calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "dangi"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196103 = Temporal.PlainYearMonth.from({ year: 1961, monthCode: "M03", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 23 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 24 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 25 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 26 + const date202102 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M02", calendar }); 27 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar });; 28 + const date202104 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M04", calendar }); 29 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 30 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 31 + const date202109 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M09", calendar }); 32 + const date202112 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M12", calendar }); 33 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 34 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 35 + const date202307 = Temporal.PlainYearMonth.from({ year: 2023, monthCode: "M07", calendar }); 36 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 37 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 38 + 39 + const tests = [ 40 + [ 41 + date202107, date202107, "same day", 42 + ["years", 0, 0], 43 + ["months", 0, 0], 44 + ], 45 + [ 46 + date202107, date202108, "1 month in same year (30-day month to 29-day month)", 47 + ["years", 0, 1], 48 + ["months", 0, 1], 49 + ], 50 + [ 51 + date202012, date202101, "1 month in different year", 52 + ["years", 0, 1], 53 + ["months", 0, 1], 54 + ], 55 + [ 56 + date202101, date202102, "1 month in same year (29-day month to 30-day month)", 57 + ["years", 0, 1], 58 + ["months", 0, 1], 59 + ], 60 + [ 61 + date202107, date202109, "2 months which both have 30 days", 62 + ["years", 0, 2], 63 + ["months", 0, 2], 64 + ], 65 + [ 66 + date202107, date202207, "1 year", 67 + ["years", 1, 0], 68 + ["months", 0, 12], 69 + ], 70 + [ 71 + date202107, date203107, "10 years", 72 + ["years", 10, 0], 73 + ["months", 0, 124], 74 + ], 75 + [ 76 + date202107, date202209, "1 year 2 months", 77 + ["years", 1, 2], 78 + ], 79 + [ 80 + date202107, date203112, "10 years and 5 months", 81 + ["years", 10, 5], 82 + ], 83 + [ 84 + date199712, date202107, "23 years and 7 months", 85 + ["years", 23, 7], 86 + ], 87 + [ 88 + date199707, date202107, "24 years", 89 + ["years", 24, 0], 90 + ], 91 + [ 92 + date196002, date202003, "60 years, 1 month", 93 + ["years", 60, 1], 94 + ], 95 + [ 96 + date202103, date202107, "4 months", 97 + ["years", 0, 4], 98 + ], 99 + [ 100 + date202003, date202107, "1 year, 4 months", 101 + ["years", 1, 4], 102 + ], 103 + [ 104 + date196003, date202107, "61 years, 4 months", 105 + ["years", 61, 4], 106 + ], 107 + [ 108 + date201912, date202107, "1 year, 7 months", 109 + ["years", 1, 7], 110 + ], 111 + [ 112 + date202012, date202107, "7 months", 113 + ["years", 0, 7], 114 + ], 115 + [ 116 + date199712, date202107, "23 years, 7 months", 117 + ["years", 23, 7], 118 + ], 119 + [ 120 + date201912, date202103, "1 year, 3 months", 121 + ["years", 1, 3], 122 + ], 123 + [ 124 + date202108, date202107, "negative 1 month in same year", 125 + ["years", 0, -1], 126 + ["months", 0, -1], 127 + ], 128 + [ 129 + date202101, date202012, "negative 1 month in different year", 130 + ["years", 0, -1], 131 + ["months", 0, -1], 132 + ], 133 + [ 134 + date202104, date202102, "negative 2 months which both have 30 days", 135 + ["years", 0, -2], 136 + ["months", 0, -2], 137 + ], 138 + [ 139 + date202207, date202107, "negative 1 year", 140 + ["years", -1, 0], 141 + ["months", 0, -12], 142 + ], 143 + [ 144 + date203107, date202107, "negative 10 years", 145 + ["years", -10, 0], 146 + ["months", 0, -124], 147 + ], 148 + [ 149 + date202209, date202107, "negative 1 year 2 months", 150 + ["years", -1, -2], 151 + ], 152 + [ 153 + date203112, date202107, "negative 10 years and 5 months", 154 + ["years", -10, -5], 155 + ], 156 + [ 157 + date202107, date199712, "negative 23 years and 8 months", 158 + ["years", -23, -8], 159 + ], 160 + [ 161 + date202107, date199707, "negative 24 years", 162 + ["years", -24, 0], 163 + ], 164 + [ 165 + date202003, date196002, "negative 60 years, 1 month", 166 + ["years", -60, -1], 167 + ], 168 + [ 169 + date202107, date202103, "negative 4 months", 170 + ["years", 0, -4], 171 + ], 172 + [ 173 + date202207, date202103, "negative 1 year, 4 months", 174 + ["years", -1, -4], 175 + ], 176 + [ 177 + date202207, date196103, "negative 61 years, 4 months", 178 + ["years", -61, -4], 179 + ], 180 + [ 181 + date202307, date202112, "negative 1 year, 7 months", 182 + ["years", -1, -7], 183 + ], 184 + [ 185 + date202107, date202012, "negative 7 months", 186 + ["years", 0, -7], 187 + ], 188 + [ 189 + date202107, date199712, "negative 23 years, 8 months", 190 + ["years", -23, -8], 191 + ], 192 + [ 193 + date202103, date201912, "negative 1 year, 3 months", 194 + ["years", -1, -3], 195 + ] 196 + ]; 197 + 198 + for (const [one, two, descr, ...units] of tests) { 199 + for (const [largestUnit, years, months] of units) { 200 + TemporalHelpers.assertDuration( 201 + one.until(two, { largestUnit }), 202 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 203 + `${descr} (largestUnit = ${largestUnit})` 204 + ); 205 + } 206 + }
+209
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-ethioaa.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (ethioaa calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "ethioaa"; 14 + 15 + // Years 16 + 17 + const date745302 = Temporal.PlainYearMonth.from({ year: 7453, monthCode: "M02", calendar }); 18 + const date745303 = Temporal.PlainYearMonth.from({ year: 7453, monthCode: "M03", calendar }); 19 + const date745403 = Temporal.PlainYearMonth.from({ year: 7454, monthCode: "M03", calendar }); 20 + const date748912 = Temporal.PlainYearMonth.from({ year: 7489, monthCode: "M12", calendar }); 21 + const date749007 = Temporal.PlainYearMonth.from({ year: 7490, monthCode: "M07", calendar }); 22 + const date749012 = Temporal.PlainYearMonth.from({ year: 7490, monthCode: "M12", calendar }); 23 + const date749013 = Temporal.PlainYearMonth.from({ year: 7490, monthCode: "M13", calendar }); 24 + const date749305 = Temporal.PlainYearMonth.from({ year: 7493, monthCode: "M05", calendar }); 25 + const date751212 = Temporal.PlainYearMonth.from({ year: 7512, monthCode: "M12", calendar }); 26 + const date751213 = Temporal.PlainYearMonth.from({ year: 7512, monthCode: "M13", calendar }); 27 + const date751303 = Temporal.PlainYearMonth.from({ year: 7513, monthCode: "M03", calendar }); 28 + const date751313 = Temporal.PlainYearMonth.from({ year: 7513, monthCode: "M13", calendar }); 29 + const date751401 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M01", calendar }); 30 + const date751402 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M02", calendar }); 31 + const date751403 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M03", calendar }); 32 + const date751404 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M04", calendar }); 33 + const date751406 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M06", calendar }); 34 + const date751407 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M07", calendar }); 35 + const date751408 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M08", calendar }); 36 + const date751412 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M12", calendar }); 37 + const date751507 = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M07", calendar }); 38 + const date751509 = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M09", calendar }); 39 + const date751607 = Temporal.PlainYearMonth.from({ year: 7516, monthCode: "M07", calendar }); 40 + const date752407 = Temporal.PlainYearMonth.from({ year: 7524, monthCode: "M07", calendar }); 41 + const date752412 = Temporal.PlainYearMonth.from({ year: 7524, monthCode: "M12", calendar }); 42 + 43 + const tests = [ 44 + [ 45 + date751407, date751407, "same day", 46 + ["years", 0, 0], 47 + ["months", 0, 0], 48 + ], 49 + [ 50 + date751407, date751408, "1 month in same year (30-day month to 29-day month)", 51 + ["years", 0, 1], 52 + ["months", 0, 1], 53 + ], 54 + [ 55 + date751313, date751401, "1 month in different year", 56 + ["years", 0, 1], 57 + ["months", 0, 1], 58 + ], 59 + [ 60 + date751401, date751402, "1 month in same year (29-day month to 30-day month)", 61 + ["years", 0, 1], 62 + ["months", 0, 1], 63 + ], 64 + [ 65 + date751407, date751507, "1 year", 66 + ["years", 1, 0], 67 + ["months", 0, 13], 68 + ], 69 + [ 70 + date751407, date752407, "10 years", 71 + ["years", 10, 0], 72 + ["months", 0, 130], 73 + ], 74 + [ 75 + date751407, date751509, "1 year 2 months", 76 + ["years", 1, 2], 77 + ], 78 + [ 79 + date751407, date752412, "10 years and 5 months", 80 + ["years", 10, 5], 81 + ], 82 + [ 83 + date749012, date751406, "23 years and 7 months", 84 + ["years", 23, 7], 85 + ], 86 + [ 87 + date749007, date751407, "24 years", 88 + ["years", 24, 0], 89 + ], 90 + [ 91 + date749007, date751406, "23 years, 12 months", 92 + ["years", 23, 12], 93 + ], 94 + [ 95 + date745302, date751303, "60 years, 1 month", 96 + ["years", 60, 1], 97 + ], 98 + [ 99 + date751403, date751407, "4 months", 100 + ["years", 0, 4], 101 + ], 102 + [ 103 + date751303, date751407, "1 year, 4 months", 104 + ["years", 1, 4], 105 + ], 106 + [ 107 + date748912, date749305, "3 years, 6 months", 108 + ["years", 3, 6], 109 + ], 110 + [ 111 + date745303, date751407, "61 years, 4 months", 112 + ["years", 61, 4], 113 + ], 114 + [ 115 + date751212, date751407, "1 year, 8 months", 116 + ["years", 1, 8], 117 + ], 118 + [ 119 + date751313, date751406, "6 months", 120 + ["years", 0, 6], 121 + ], 122 + [ 123 + date749013, date751406, "23 years, 6 months", 124 + ["years", 23, 6], 125 + ], 126 + [ 127 + date751213, date751402, "1 year, 2 months", 128 + ["years", 1, 2], 129 + ], 130 + [ 131 + date751408, date751407, "negative 1 month in same year", 132 + ["years", 0, -1], 133 + ["months", 0, -1], 134 + ], 135 + [ 136 + date751401, date751313, "negative 1 month in different year", 137 + ["years", 0, -1], 138 + ["months", 0, -1], 139 + ], 140 + [ 141 + date751404, date751402, "negative 2 months which both have 30 days", 142 + ["years", 0, -2], 143 + ["months", 0, -2], 144 + ], 145 + [ 146 + date751507, date751407, "negative 1 year", 147 + ["years", -1, 0], 148 + ["months", 0, -13], 149 + ], 150 + [ 151 + date752407, date751407, "negative 10 years", 152 + ["years", -10, 0], 153 + ["months", 0, -130], 154 + ], 155 + [ 156 + date751509, date751407, "negative 1 year 2 months", 157 + ["years", -1, -2], 158 + ], 159 + [ 160 + date752412, date751407, "negative 10 years and 5 months", 161 + ["years", -10, -5], 162 + ], 163 + [ 164 + date751407, date749012, "negative 23 years and 8 months", 165 + ["years", -23, -8], 166 + ], 167 + [ 168 + date751407, date749007, "negative 24 years", 169 + ["years", -24, 0], 170 + ], 171 + [ 172 + date751303, date745302, "negative 60 years, 1 month", 173 + ["years", -60, -1], 174 + ], 175 + [ 176 + date751407, date751403, "negative 4 months", 177 + ["years", 0, -4], 178 + ], 179 + [ 180 + date751507, date751403, "negative 1 year, 4 months", 181 + ["years", -1, -4], 182 + ], 183 + [ 184 + date751507, date745403, "negative 61 years, 4 months", 185 + ["years", -61, -4], 186 + ], 187 + [ 188 + date751607, date751412, "negative 1 year, 8 months", 189 + ["years", -1, -8], 190 + ], 191 + [ 192 + date751507, date751412, "negative 8 months", 193 + ["years", 0, -8], 194 + ], 195 + [ 196 + date751407, date749012, "negative 23 years, 8 months", 197 + ["years", -23, -8], 198 + ] 199 + ]; 200 + 201 + for (const [one, two, descr, ...units] of tests) { 202 + for (const [largestUnit, years, months] of units) { 203 + TemporalHelpers.assertDuration( 204 + one.until(two, { largestUnit }), 205 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 206 + `${descr} (largestUnit = ${largestUnit})` 207 + ); 208 + } 209 + }
+214
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-ethiopic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (ethiopic calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "ethiopic"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196103 = Temporal.PlainYearMonth.from({ year: 1961, monthCode: "M03", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date199713 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M13", calendar }); 23 + const date200001 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M01", calendar }); 24 + const date200010 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M10", calendar }); 25 + const date200105 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M05", calendar }); 26 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 27 + const date201913 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M13", calendar }); 28 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 29 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 30 + const date202013 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M13", calendar }); 31 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 32 + const date202102 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M02", calendar }); 33 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar });; 34 + const date202104 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M04", calendar }); 35 + const date202106 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M06", calendar }); 36 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 37 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 38 + const date202112 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M12", calendar }); 39 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 40 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 41 + const date202307 = Temporal.PlainYearMonth.from({ year: 2023, monthCode: "M07", calendar }); 42 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 43 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 44 + 45 + const tests = [ 46 + [ 47 + date202107, date202107, "same day", 48 + ["years", 0, 0], 49 + ["months", 0, 0], 50 + ], 51 + [ 52 + date202107, date202108, "1 month in same year (30-day month to 29-day month)", 53 + ["years", 0, 1], 54 + ["months", 0, 1], 55 + ], 56 + [ 57 + date202013, date202101, "1 month in different year", 58 + ["years", 0, 1], 59 + ["months", 0, 1], 60 + ], 61 + [ 62 + date202101, date202102, "1 month in same year (29-day month to 30-day month)", 63 + ["years", 0, 1], 64 + ["months", 0, 1], 65 + ], 66 + [ 67 + date202207, date202307, "1 year", 68 + ["years", 1, 0], 69 + ["months", 0, 13], 70 + ], 71 + [ 72 + date202107, date203107, "10 years", 73 + ["years", 10, 0], 74 + ["months", 0, 130], 75 + ], 76 + [ 77 + date202107, date202209, "1 year 2 months", 78 + ["years", 1, 2], 79 + ], 80 + [ 81 + date202107, date203112, "10 years and 5 months", 82 + ["years", 10, 5], 83 + ], 84 + [ 85 + date199712, date202106, "23 years and 7 months", 86 + ["years", 23, 7], 87 + ], 88 + [ 89 + date199707, date202107, "24 years", 90 + ["years", 24, 0], 91 + ], 92 + [ 93 + date199707, date202106, "23 years, 12 months", 94 + ["years", 23, 12], 95 + ], 96 + [ 97 + date196002, date202003, "60 years, 1 month", 98 + ["years", 60, 1], 99 + ], 100 + [ 101 + date202103, date202107, "4 months", 102 + ["years", 0, 4], 103 + ], 104 + [ 105 + date202003, date202107, "1 year, 4 months", 106 + ["years", 1, 4], 107 + ], 108 + [ 109 + date199712, date200105, "3 years, 6 months", 110 + ["years", 3, 6], 111 + ], 112 + [ 113 + date196003, date202107, "61 years, 4 months", 114 + ["years", 61, 4], 115 + ], 116 + [ 117 + date201912, date202107, "1 year, 8 months", 118 + ["years", 1, 8], 119 + ], 120 + [ 121 + date202013, date202106, "6 months", 122 + ["years", 0, 6], 123 + ], 124 + [ 125 + date200001, date200010, "40 weeks", 126 + ], 127 + [ 128 + date199713, date202106, "23 years, 6 months", 129 + ["years", 23, 6], 130 + ], 131 + [ 132 + date201913, date202102, "1 year, 2 months", 133 + ["years", 1, 2], 134 + ], 135 + [ 136 + date202108, date202107, "negative 1 month in same year", 137 + ["years", 0, -1], 138 + ["months", 0, -1], 139 + ], 140 + [ 141 + date202101, date202013, "negative 1 month in different year", 142 + ["years", 0, -1], 143 + ["months", 0, -1], 144 + ], 145 + [ 146 + date202104, date202102, "negative 2 months which both have 30 days", 147 + ["years", 0, -2], 148 + ["months", 0, -2], 149 + ], 150 + [ 151 + date202307, date202207, "negative 1 year", 152 + ["years", -1, 0], 153 + ["months", 0, -13], 154 + ], 155 + [ 156 + date203107, date202107, "negative 10 years", 157 + ["years", -10, 0], 158 + ["months", 0, -130], 159 + ], 160 + [ 161 + date202209, date202107, "negative 1 year 2 months", 162 + ["years", -1, -2], 163 + ], 164 + [ 165 + date203112, date202107, "negative 10 years and 5 months", 166 + ["years", -10, -5], 167 + ], 168 + [ 169 + date202107, date199712, "negative 23 years and 8 months", 170 + ["years", -23, -8], 171 + ], 172 + [ 173 + date202107, date199707, "negative 24 years", 174 + ["years", -24, 0], 175 + ], 176 + [ 177 + date202003, date196002, "negative 60 years, 1 month", 178 + ["years", -60, -1], 179 + ], 180 + [ 181 + date202107, date202103, "negative 4 months", 182 + ["years", 0, -4], 183 + ], 184 + [ 185 + date202207, date202103, "negative 1 year, 4 months", 186 + ["years", -1, -4], 187 + ], 188 + [ 189 + date202207, date196103, "negative 61 years, 4 months", 190 + ["years", -61, -4], 191 + ], 192 + [ 193 + date202307, date202112, "negative 1 year, 8 months", 194 + ["years", -1, -8], 195 + ], 196 + [ 197 + date202107, date202012, "negative 8 months", 198 + ["years", 0, -8], 199 + ], 200 + [ 201 + date202107, date199712, "negative 23 years, 8 months", 202 + ["years", -23, -8], 203 + ], 204 + ]; 205 + 206 + for (const [one, two, descr, ...units] of tests) { 207 + for (const [largestUnit, years, months] of units) { 208 + TemporalHelpers.assertDuration( 209 + one.until(two, { largestUnit }), 210 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 211 + `${descr} (largestUnit = ${largestUnit})` 212 + ); 213 + } 214 + }
+211
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-gregory.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (gregory calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "gregory"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196907 = Temporal.PlainYearMonth.from({ year: 1969, monthCode: "M07", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date200106 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M06", calendar }); 23 + const date201907 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M07", calendar }); 24 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 25 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 26 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 27 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 28 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar }); 29 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 30 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 31 + const date202109 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M09", calendar }); 32 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 33 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 34 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 35 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 36 + 37 + const tests = [ 38 + [ 39 + date202107, date202107, "same day", 40 + ["years", 0, 0], 41 + ["months", 0, 0], 42 + ], 43 + [ 44 + date202107, date202108, "1 month in same year", 45 + ["years", 0, 1], 46 + ["months", 0, 1], 47 + ], 48 + [ 49 + date202012, date202101, "1 month in different year", 50 + ["years", 0, 1], 51 + ["months", 0, 1], 52 + ], 53 + [ 54 + date202107, date202109, "2 months which both have 31 days", 55 + ["years", 0, 2], 56 + ["months", 0, 2], 57 + ], 58 + [ 59 + date202107, date202207, "1 year", 60 + ["years", 1, 0], 61 + ["months", 0, 12], 62 + ], 63 + [ 64 + date202107, date203107, "10 years", 65 + ["years", 10, 0], 66 + ["months", 0, 120], 67 + ], 68 + [ 69 + date202107, date202209, "1 year 2 months", 70 + ["years", 1, 2], 71 + ], 72 + [ 73 + date202107, date203112, "10 years and 5 months", 74 + ["years", 10, 5], 75 + ], 76 + [ 77 + date199712, date202107, "23 years and 7 months", 78 + ["years", 23, 7], 79 + ], 80 + [ 81 + date199707, date202107, "24 years", 82 + ["years", 24, 0], 83 + ], 84 + [ 85 + date196002, date202003, "60 years, 1 month", 86 + ["years", 60, 1], 87 + ], 88 + [ 89 + date202103, date202107, "4 months", 90 + ["years", 0, 4], 91 + ], 92 + [ 93 + date202003, date202107, "1 year, 4 months", 94 + ["years", 1, 4], 95 + ], 96 + [ 97 + date199712, date200106, "3 years, 6 months", 98 + ["years", 3, 6], 99 + ], 100 + [ 101 + date196003, date202107, "61 years, 4 months", 102 + ["years", 61, 4], 103 + ], 104 + [ 105 + date201912, date202107, "1 year, 7 months", 106 + ["years", 1, 7], 107 + ], 108 + [ 109 + date202012, date202107, "7 months", 110 + ["years", 0, 7], 111 + ], 112 + [ 113 + date199712, date202107, "23 years, 7 months", 114 + ["years", 23, 7], 115 + ], 116 + [ 117 + date201912, date202103, "1 year, 3 months", 118 + ["years", 1, 3], 119 + ], 120 + [ 121 + date196907, date201907, "crossing epoch", 122 + ["years", 50, 0], 123 + ], 124 + [ 125 + date202108, date202107, "negative 1 month in same year", 126 + ["years", 0, -1], 127 + ["months", 0, -1], 128 + ], 129 + [ 130 + date202101, date202012, "negative 1 month in different year", 131 + ["years", 0, -1], 132 + ["months", 0, -1], 133 + ], 134 + [ 135 + date202109, date202107, "negative 2 months which both have 31 days", 136 + ["years", 0, -2], 137 + ["months", 0, -2], 138 + ], 139 + [ 140 + date202207, date202107, "negative 1 year", 141 + ["years", -1, 0], 142 + ["months", 0, -12], 143 + ], 144 + [ 145 + date203107, date202107, "negative 10 years", 146 + ["years", -10, 0], 147 + ["months", 0, -120], 148 + ], 149 + [ 150 + date202209, date202107, "negative 1 year 2 months", 151 + ["years", -1, -2], 152 + ], 153 + [ 154 + date203112, date202107, "negative 10 years and 5 months", 155 + ["years", -10, -5], 156 + ], 157 + [ 158 + date202107, date199712, "negative 23 years and 7 months", 159 + ["years", -23, -7], 160 + ], 161 + [ 162 + date202107, date199707, "negative 24 years", 163 + ["years", -24, 0], 164 + ], 165 + [ 166 + date202003, date196002, "negative 60 years, 1 month", 167 + ["years", -60, -1], 168 + ], 169 + [ 170 + date202107, date202103, "negative 4 months", 171 + ["years", 0, -4], 172 + ], 173 + [ 174 + date202107, date202003, "negative 1 year, 4 months", 175 + ["years", -1, -4], 176 + ], 177 + [ 178 + date202107, date196003, "negative 61 years, 4 months", 179 + ["years", -61, -4], 180 + ], 181 + [ 182 + date202107, date201912, "negative 1 year, 7 months", 183 + ["years", -1, -7], 184 + ], 185 + [ 186 + date202107, date202012, "negative 7 months", 187 + ["years", 0, -7], 188 + ], 189 + [ 190 + date202107, date199712, "negative 23 years, 7 months", 191 + ["years", -23, -7], 192 + ], 193 + [ 194 + date202103, date201912, "negative 1 year, 3 months", 195 + ["years", -1, -3], 196 + ], 197 + [ 198 + date201907, date196907, "crossing epoch", 199 + ["years", -50, 0], 200 + ], 201 + ]; 202 + 203 + for (const [one, two, descr, ...units] of tests) { 204 + for (const [largestUnit, years, months] of units) { 205 + TemporalHelpers.assertDuration( 206 + one.until(two, { largestUnit }), 207 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 208 + descr 209 + ); 210 + } 211 + }
+206
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-hebrew.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (hebrew calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "hebrew"; 14 + 15 + // Years 16 + 17 + const date572202 = Temporal.PlainYearMonth.from({ year: 5722, monthCode: "M02", calendar }); 18 + const date572203 = Temporal.PlainYearMonth.from({ year: 5722, monthCode: "M03", calendar }); 19 + const date572302 = Temporal.PlainYearMonth.from({ year: 5723, monthCode: "M02", calendar }); 20 + const date572303 = Temporal.PlainYearMonth.from({ year: 5723, monthCode: "M03", calendar }); 21 + const date575912 = Temporal.PlainYearMonth.from({ year: 5759, monthCode: "M12", calendar }); 22 + const date576001 = Temporal.PlainYearMonth.from({ year: 5760, monthCode: "M01", calendar }); 23 + const date576007 = Temporal.PlainYearMonth.from({ year: 5760, monthCode: "M07", calendar }); 24 + const date576012 = Temporal.PlainYearMonth.from({ year: 5760, monthCode: "M12", calendar }); 25 + const date576206 = Temporal.PlainYearMonth.from({ year: 5762, monthCode: "M06", calendar }); 26 + const date578112 = Temporal.PlainYearMonth.from({ year: 5781, monthCode: "M12", calendar }); 27 + const date578203 = Temporal.PlainYearMonth.from({ year: 5782, monthCode: "M03", calendar }); 28 + const date578207 = Temporal.PlainYearMonth.from({ year: 5782, monthCode: "M07", calendar }); 29 + const date578212 = Temporal.PlainYearMonth.from({ year: 5782, monthCode: "M12", calendar }); 30 + const date578301 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M01", calendar }); 31 + const date578303 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M03", calendar }); 32 + const date578307 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M07", calendar }); 33 + const date578308 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M08", calendar }); 34 + const date578309 = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M09", calendar }); 35 + const date578407 = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M07", calendar }); 36 + const date578409 = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M09", calendar }); 37 + const date579307 = Temporal.PlainYearMonth.from({ year: 5793, monthCode: "M07", calendar }); 38 + const date579312 = Temporal.PlainYearMonth.from({ year: 5793, monthCode: "M12", calendar }); 39 + 40 + const tests = [ 41 + [ 42 + date578307, date578307, "same day", 43 + ["years", 0, 0], 44 + ["months", 0, 0], 45 + ], 46 + [ 47 + date578307, date578308, "1 month in same year", 48 + ["years", 0, 1], 49 + ["months", 0, 1], 50 + ], 51 + [ 52 + date578212, date578301, "1 month in different year", 53 + ["years", 0, 1], 54 + ["months", 0, 1], 55 + ], 56 + [ 57 + date578307, date578309, "2 months which both have 30 days", 58 + ["years", 0, 2], 59 + ["months", 0, 2], 60 + ], 61 + [ 62 + date578207, date578307, "1 year", 63 + ["years", 1, 0], 64 + ["months", 0, 12], 65 + ], 66 + [ 67 + date578307, date579307, "10 years", 68 + ["years", 10, 0], 69 + ["months", 0, 124], 70 + ], 71 + [ 72 + date578307, date578409, "1 year 2 months", 73 + ["years", 1, 2], 74 + ], 75 + [ 76 + date575912, date576206, "2 years 6 months", 77 + ["years", 2, 6], 78 + ], 79 + [ 80 + date578307, date579312, "10 years and 5 months", 81 + ["years", 10, 5], 82 + ], 83 + [ 84 + date576012, date578407, "23 years and 8 months", 85 + ["years", 23, 8], 86 + ], 87 + [ 88 + date576007, date578407, "24 years", 89 + ["years", 24, 0], 90 + ], 91 + [ 92 + date572302, date578303, "60 years, 1 month", 93 + ["years", 60, 1], 94 + ], 95 + [ 96 + date578303, date578307, "4 months", 97 + ["years", 0, 4], 98 + ], 99 + [ 100 + date578203, date578307, "1 year, 4 months", 101 + ["years", 1, 4], 102 + ], 103 + [ 104 + date572303, date578407, "61 years, 5 months", 105 + ["years", 61, 5], 106 + ], 107 + [ 108 + date578112, date578307, "1 year, 7 months", 109 + ["years", 1, 7], 110 + ], 111 + [ 112 + date578212, date578307, "7 months", 113 + ["years", 0, 7], 114 + ], 115 + [ 116 + date576001, date578307, "23 years, 6 months", 117 + ["years", 23, 6], 118 + ], 119 + [ 120 + date578112, date578303, "1 year, 3 months", 121 + ["years", 1, 3], 122 + ], 123 + [ 124 + date578308, date578307, "negative 1 month in same year", 125 + ["years", 0, -1], 126 + ["months", 0, -1], 127 + ], 128 + [ 129 + date578301, date578212, "negative 1 month in different year", 130 + ["years", 0, -1], 131 + ["months", 0, -1], 132 + ], 133 + [ 134 + date578309, date578307, "negative 2 months which both have 30 days", 135 + ["years", 0, -2], 136 + ["months", 0, -2], 137 + ], 138 + [ 139 + date578307, date578207, "negative 1 year", 140 + ["years", -1, 0], 141 + ["months", 0, -12], 142 + ], 143 + [ 144 + date579307, date578307, "negative 10 years", 145 + ["years", -10, 0], 146 + ["months", 0, -124], 147 + ], 148 + [ 149 + date578409, date578307, "negative 1 year 2 months", 150 + ["years", -1, -2], 151 + ], 152 + [ 153 + date579312, date578307, "negative 10 years and 5 months", 154 + ["years", -10, -5], 155 + ], 156 + [ 157 + date578407, date576012, "negative 23 years and 7 months", 158 + ["years", -23, -7], 159 + ], 160 + [ 161 + date578407, date576007, "negative 24 years", 162 + ["years", -24, 0], 163 + ], 164 + [ 165 + date578203, date572202, "negative 60 years, 1 month", 166 + ["years", -60, -1], 167 + ], 168 + [ 169 + date578307, date578303, "negative 4 months", 170 + ["years", 0, -4], 171 + ], 172 + [ 173 + date578307, date578203, "negative 1 year, 5 months", 174 + ["years", -1, -5], 175 + ], 176 + [ 177 + date578307, date572203, "negative 61 years, 5 months", 178 + ["years", -61, -5], 179 + ], 180 + [ 181 + date578307, date578112, "negative 1 year, 8 months", 182 + ["years", -1, -8], 183 + ], 184 + [ 185 + date578307, date578212, "negative 7 months", 186 + ["years", 0, -7], 187 + ], 188 + [ 189 + date578307, date575912, "negative 23 years, 8 months", 190 + ["years", -23, -8], 191 + ], 192 + [ 193 + date578303, date578112, "negative 1 year, 3 months", 194 + ["years", -1, -3], 195 + ] 196 + ]; 197 + 198 + for (const [one, two, descr, ...units] of tests) { 199 + for (const [largestUnit, years, months] of units) { 200 + TemporalHelpers.assertDuration( 201 + one.until(two, { largestUnit }), 202 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 203 + descr 204 + ); 205 + } 206 + }
+205
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-indian.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (indian calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "indian"; 14 + 15 + // Years 16 + 17 + const date188102 = Temporal.PlainYearMonth.from({ year: 1881, monthCode: "M02", calendar }); 18 + const date188202 = Temporal.PlainYearMonth.from({ year: 1882, monthCode: "M02", calendar }); 19 + const date188203 = Temporal.PlainYearMonth.from({ year: 1882, monthCode: "M03", calendar }); 20 + const date191907 = Temporal.PlainYearMonth.from({ year: 1919, monthCode: "M07", calendar }); 21 + const date191912 = Temporal.PlainYearMonth.from({ year: 1919, monthCode: "M12", calendar }); 22 + const date192306 = Temporal.PlainYearMonth.from({ year: 1923, monthCode: "M06", calendar }); 23 + const date194103 = Temporal.PlainYearMonth.from({ year: 1941, monthCode: "M03", calendar }); 24 + const date194112 = Temporal.PlainYearMonth.from({ year: 1941, monthCode: "M12", calendar }); 25 + const date194203 = Temporal.PlainYearMonth.from({ year: 1942, monthCode: "M03", calendar }); 26 + const date194212 = Temporal.PlainYearMonth.from({ year: 1942, monthCode: "M12", calendar }); 27 + const date194301 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M01", calendar }); 28 + const date194302 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M02", calendar }); 29 + const date194303 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M03", calendar });; 30 + const date194304 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M04", calendar }); 31 + const date194306 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M06", calendar }); 32 + const date194307 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M07", calendar }); 33 + const date194308 = Temporal.PlainYearMonth.from({ year: 1943, monthCode: "M08", calendar }); 34 + const date194407 = Temporal.PlainYearMonth.from({ year: 1944, monthCode: "M07", calendar }); 35 + const date194409 = Temporal.PlainYearMonth.from({ year: 1944, monthCode: "M09", calendar }); 36 + const date195307 = Temporal.PlainYearMonth.from({ year: 1953, monthCode: "M07", calendar }); 37 + const date195312 = Temporal.PlainYearMonth.from({ year: 1953, monthCode: "M12", calendar }); 38 + 39 + const tests = [ 40 + [ 41 + date194307, date194307, "same day", 42 + ["years", 0, 0], 43 + ["months", 0, 0], 44 + ], 45 + [ 46 + date194307, date194308, "1 month in same year", 47 + ["years", 0, 1], 48 + ["months", 0, 1], 49 + ], 50 + [ 51 + date194212, date194301, "1 month in different year", 52 + ["years", 0, 1], 53 + ["months", 0, 1], 54 + ], 55 + [ 56 + date194302, date194304, "2 months which both have 31 days", 57 + ["years", 0, 2], 58 + ["months", 0, 2], 59 + ], 60 + [ 61 + date194307, date194407, "1 year", 62 + ["years", 1, 0], 63 + ["months", 0, 12], 64 + ], 65 + [ 66 + date194307, date195307, "10 years", 67 + ["years", 10, 0], 68 + ["months", 0, 120], 69 + ], 70 + [ 71 + date194307, date194409, "1 year 2 months", 72 + ["years", 1, 2], 73 + ], 74 + [ 75 + date194307, date195312, "10 years and 5 months", 76 + ["years", 10, 5], 77 + ], 78 + [ 79 + date191912, date194307, "23 years and 7 months", 80 + ["years", 23, 7], 81 + ], 82 + [ 83 + date191907, date194307, "24 years", 84 + ["years", 24, 0], 85 + ], 86 + [ 87 + date188202, date194203, "60 years, 1 month", 88 + ["years", 60, 1], 89 + ], 90 + [ 91 + date194303, date194307, "4 months", 92 + ["years", 0, 4], 93 + ], 94 + [ 95 + date194203, date194307, "1 year, 4 months", 96 + ["years", 1, 4], 97 + ], 98 + [ 99 + date191912, date192306, "3 years, 6 months", 100 + ["years", 3, 6], 101 + ], 102 + [ 103 + date188203, date194307, "61 years, 4 months", 104 + ["years", 61, 4], 105 + ], 106 + [ 107 + date194112, date194307, "1 year, 7 months", 108 + ["years", 1, 7], 109 + ], 110 + [ 111 + date194212, date194307, "7 months", 112 + ["years", 0, 7], 113 + ], 114 + [ 115 + date191912, date194307, "23 years, 7 months", 116 + ["years", 23, 7], 117 + ], 118 + [ 119 + date194112, date194303, "1 year, 3 months", 120 + ["years", 1, 3], 121 + ], 122 + [ 123 + date194308, date194307, "negative 1 month in same year", 124 + ["years", 0, -1], 125 + ["months", 0, -1], 126 + ], 127 + [ 128 + date194301, date194212, "negative 1 month in different year", 129 + ["years", 0, -1], 130 + ["months", 0, -1], 131 + ], 132 + [ 133 + date194306, date194304, "negative 2 months which both have 31 days", 134 + ["years", 0, -2], 135 + ["months", 0, -2], 136 + ], 137 + [ 138 + date194407, date194307, "negative 1 year", 139 + ["years", -1, 0], 140 + ["months", 0, -12], 141 + ], 142 + [ 143 + date195307, date194307, "negative 10 years", 144 + ["years", -10, 0], 145 + ["months", 0, -120], 146 + ], 147 + [ 148 + date194409, date194307, "negative 1 year 2 months", 149 + ["years", -1, -2], 150 + ], 151 + [ 152 + date195312, date194307, "negative 10 years and 5 months", 153 + ["years", -10, -5], 154 + ], 155 + [ 156 + date194307, date191912, "negative 23 years and 7 months", 157 + ["years", -23, -7], 158 + ], 159 + [ 160 + date194307, date191907, "negative 24 years", 161 + ["years", -24, 0], 162 + ], 163 + [ 164 + date194103, date188102, "negative 60 years, 1 month", 165 + ["years", -60, -1], 166 + ], 167 + [ 168 + date194307, date194303, "negative 4 months", 169 + ["years", 0, -4], 170 + ], 171 + [ 172 + date194307, date194203, "negative 1 year, 4 months", 173 + ["years", -1, -4], 174 + ], 175 + [ 176 + date194307, date188203, "negative 61 years, 4 months", 177 + ["years", -61, -4], 178 + ], 179 + [ 180 + date194307, date194112, "negative 1 year, 7 months", 181 + ["years", -1, -7], 182 + ], 183 + [ 184 + date194307, date194212, "negative 7 months", 185 + ["years", 0, -7], 186 + ], 187 + [ 188 + date194307, date191912, "negative 23 years, 7 months", 189 + ["years", -23, -7], 190 + ], 191 + [ 192 + date194303, date194112, "negative 1 year, 3 months", 193 + ["years", -1, -3], 194 + ] 195 + ]; 196 + 197 + for (const [one, two, descr, ...units] of tests) { 198 + for (const [largestUnit, years, months] of units) { 199 + TemporalHelpers.assertDuration( 200 + one.until(two, { largestUnit }), 201 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 202 + descr 203 + ); 204 + } 205 + }
+204
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-islamic-civil.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (Islamic civil calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "islamic-civil"; 14 + 15 + // Years 16 + 17 + const date137702 = Temporal.PlainYearMonth.from({ year: 1377, monthCode: "M02", calendar }); 18 + const date137802 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M02", calendar }); 19 + const date137803 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M03", calendar }); 20 + const date141507 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M07", calendar }); 21 + const date141512 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M12", calendar }); 22 + const date141712 = Temporal.PlainYearMonth.from({ year: 1417, monthCode: "M12", calendar }); 23 + const date142106 = Temporal.PlainYearMonth.from({ year: 1421, monthCode: "M06", calendar }); 24 + const date143703 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M03", calendar }); 25 + const date143712 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M12", calendar }); 26 + const date143803 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M03", calendar }); 27 + const date143812 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M12", calendar }); 28 + const date143901 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M01", calendar }); 29 + const date143903 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M03", calendar }); 30 + const date143905 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M05", calendar }); 31 + const date143907 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M07", calendar }); 32 + const date143908 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M08", calendar }); 33 + const date144007 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M07", calendar }); 34 + const date144009 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M09", calendar }); 35 + const date144907 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M07", calendar }); 36 + const date144912 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M12", calendar }); 37 + 38 + const tests = [ 39 + [ 40 + date143907, date143907, "same day", 41 + ["years", 0, 0], 42 + ["months", 0, 0], 43 + ], 44 + [ 45 + date143907, date143908, "1 month in same year", 46 + ["years", 0, 1], 47 + ["months", 0, 1], 48 + ], 49 + [ 50 + date143812, date143901, "1 month in different year", 51 + ["years", 0, 1], 52 + ["months", 0, 1], 53 + ], 54 + [ 55 + date143903, date143905, "2 months which both have 30 days", 56 + ["years", 0, 2], 57 + ["months", 0, 2], 58 + ], 59 + [ 60 + date143907, date144007, "1 year", 61 + ["years", 1, 0], 62 + ["months", 0, 12], 63 + ], 64 + [ 65 + date143907, date144907, "10 years", 66 + ["years", 10, 0], 67 + ["months", 0, 120], 68 + ], 69 + [ 70 + date143907, date144009, "1 year 2 months", 71 + ["years", 1, 2], 72 + ], 73 + [ 74 + date143907, date144912, "10 years and 5 months", 75 + ["years", 10, 5], 76 + ], 77 + [ 78 + date141512, date143907, "23 years and 7 months", 79 + ["years", 23, 7], 80 + ], 81 + [ 82 + date141507, date143907, "24 years", 83 + ["years", 24, 0], 84 + ], 85 + [ 86 + date137802, date143803, "60 years, 1 month", 87 + ["years", 60, 1], 88 + ], 89 + [ 90 + date143903, date143907, "4 months", 91 + ["years", 0, 4], 92 + ], 93 + [ 94 + date143803, date143907, "1 year, 4 months", 95 + ["years", 1, 4], 96 + ], 97 + [ 98 + date141712, date142106, "3 years, 6 months", 99 + ["years", 3, 6], 100 + ], 101 + [ 102 + date137803, date143907, "61 years, 4 months", 103 + ["years", 61, 4], 104 + ], 105 + [ 106 + date143712, date143907, "1 year, 7 months", 107 + ["years", 1, 7], 108 + ], 109 + [ 110 + date143812, date143907, "7 months", 111 + ["years", 0, 7], 112 + ], 113 + [ 114 + date141512, date143907, "23 years, 7 months", 115 + ["years", 23, 7], 116 + ], 117 + [ 118 + date143712, date143903, "1 year, 3 months", 119 + ["years", 1, 3], 120 + ], 121 + [ 122 + date143908, date143907, "negative 1 month in same year", 123 + ["years", 0, -1], 124 + ["months", 0, -1], 125 + ], 126 + [ 127 + date143901, date143812, "negative 1 month in different year", 128 + ["years", 0, -1], 129 + ["months", 0, -1], 130 + ], 131 + [ 132 + date143907, date143905, "negative 2 months which both have 30 days", 133 + ["years", 0, -2], 134 + ["months", 0, -2], 135 + ], 136 + [ 137 + date144007, date143907, "negative 1 year", 138 + ["years", -1, 0], 139 + ["months", 0, -12], 140 + ], 141 + [ 142 + date144907, date143907, "negative 10 years", 143 + ["years", -10, 0], 144 + ["months", 0, -120], 145 + ], 146 + [ 147 + date144009, date143907, "negative 1 year 2 months", 148 + ["years", -1, -2], 149 + ], 150 + [ 151 + date144912, date143907, "negative 10 years and 5 months", 152 + ["years", -10, -5], 153 + ], 154 + [ 155 + date143907, date141512, "negative 23 years and 7 months", 156 + ["years", -23, -7], 157 + ], 158 + [ 159 + date143907, date141507, "negative 24 years", 160 + ["years", -24, 0], 161 + ], 162 + [ 163 + date143703, date137702, "negative 60 years, 1 month", 164 + ["years", -60, -1], 165 + ], 166 + [ 167 + date143907, date143903, "negative 4 months", 168 + ["years", 0, -4], 169 + ], 170 + [ 171 + date143907, date143803, "negative 1 year, 4 months", 172 + ["years", -1, -4], 173 + ], 174 + [ 175 + date143907, date137803, "negative 61 years, 4 months", 176 + ["years", -61, -4], 177 + ], 178 + [ 179 + date143907, date143712, "negative 1 year, 7 months", 180 + ["years", -1, -7], 181 + ], 182 + [ 183 + date143907, date143812, "negative 7 months", 184 + ["years", 0, -7], 185 + ], 186 + [ 187 + date143907, date141512, "negative 23 years, 7 months", 188 + ["years", -23, -7], 189 + ], 190 + [ 191 + date143903, date143712, "negative 1 year, 3 months", 192 + ["years", -1, -3], 193 + ] 194 + ]; 195 + 196 + for (const [one, two, descr, ...units] of tests) { 197 + for (const [largestUnit, years, months] of units) { 198 + TemporalHelpers.assertDuration( 199 + one.until(two, { largestUnit }), 200 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 201 + descr 202 + ); 203 + } 204 + }
+204
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-islamic-tbla.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (Islamic tbla calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "islamic-tbla"; 14 + 15 + // Years 16 + 17 + const date137702 = Temporal.PlainYearMonth.from({ year: 1377, monthCode: "M02", calendar }); 18 + const date137802 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M02", calendar }); 19 + const date137803 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M03", calendar }); 20 + const date141507 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M07", calendar }); 21 + const date141512 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M12", calendar }); 22 + const date141712 = Temporal.PlainYearMonth.from({ year: 1417, monthCode: "M12", calendar }); 23 + const date142106 = Temporal.PlainYearMonth.from({ year: 1421, monthCode: "M06", calendar }); 24 + const date143703 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M03", calendar }); 25 + const date143712 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M12", calendar }); 26 + const date143803 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M03", calendar }); 27 + const date143812 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M12", calendar }); 28 + const date143901 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M01", calendar }); 29 + const date143903 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M03", calendar }); 30 + const date143905 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M05", calendar }); 31 + const date143907 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M07", calendar }); 32 + const date143908 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M08", calendar }); 33 + const date144007 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M07", calendar }); 34 + const date144009 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M09", calendar }); 35 + const date144907 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M07", calendar }); 36 + const date144912 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M12", calendar }); 37 + 38 + const tests = [ 39 + [ 40 + date143907, date143907, "same day", 41 + ["years", 0, 0], 42 + ["months", 0, 0], 43 + ], 44 + [ 45 + date143907, date143908, "1 month in same year", 46 + ["years", 0, 1], 47 + ["months", 0, 1], 48 + ], 49 + [ 50 + date143812, date143901, "1 month in different year", 51 + ["years", 0, 1], 52 + ["months", 0, 1], 53 + ], 54 + [ 55 + date143903, date143905, "2 months which both have 30 days", 56 + ["years", 0, 2], 57 + ["months", 0, 2], 58 + ], 59 + [ 60 + date143907, date144007, "1 year", 61 + ["years", 1, 0], 62 + ["months", 0, 12], 63 + ], 64 + [ 65 + date143907, date144907, "10 years", 66 + ["years", 10, 0], 67 + ["months", 0, 120], 68 + ], 69 + [ 70 + date143907, date144009, "1 year 2 months", 71 + ["years", 1, 2], 72 + ], 73 + [ 74 + date143907, date144912, "10 years and 5 months", 75 + ["years", 10, 5], 76 + ], 77 + [ 78 + date141512, date143907, "23 years and 7 months", 79 + ["years", 23, 7], 80 + ], 81 + [ 82 + date141507, date143907, "24 years", 83 + ["years", 24, 0], 84 + ], 85 + [ 86 + date137802, date143803, "60 years, 1 month", 87 + ["years", 60, 1], 88 + ], 89 + [ 90 + date143903, date143907, "4 months", 91 + ["years", 0, 4], 92 + ], 93 + [ 94 + date143803, date143907, "1 year, 4 months", 95 + ["years", 1, 4], 96 + ], 97 + [ 98 + date141712, date142106, "3 years, 6 months", 99 + ["years", 3, 6], 100 + ], 101 + [ 102 + date137803, date143907, "61 years, 4 months", 103 + ["years", 61, 4], 104 + ], 105 + [ 106 + date143712, date143907, "1 year, 7 months", 107 + ["years", 1, 7], 108 + ], 109 + [ 110 + date143812, date143907, "7 months", 111 + ["years", 0, 7], 112 + ], 113 + [ 114 + date141512, date143907, "23 years, 7 months", 115 + ["years", 23, 7], 116 + ], 117 + [ 118 + date143712, date143903, "1 year, 3 months", 119 + ["years", 1, 3], 120 + ], 121 + [ 122 + date143908, date143907, "negative 1 month in same year", 123 + ["years", 0, -1], 124 + ["months", 0, -1], 125 + ], 126 + [ 127 + date143901, date143812, "negative 1 month in different year", 128 + ["years", 0, -1], 129 + ["months", 0, -1], 130 + ], 131 + [ 132 + date143907, date143905, "negative 2 months which both have 30 days", 133 + ["years", 0, -2], 134 + ["months", 0, -2], 135 + ], 136 + [ 137 + date144007, date143907, "negative 1 year", 138 + ["years", -1, 0], 139 + ["months", 0, -12], 140 + ], 141 + [ 142 + date144907, date143907, "negative 10 years", 143 + ["years", -10, 0], 144 + ["months", 0, -120], 145 + ], 146 + [ 147 + date144009, date143907, "negative 1 year 2 months", 148 + ["years", -1, -2], 149 + ], 150 + [ 151 + date144912, date143907, "negative 10 years and 5 months", 152 + ["years", -10, -5], 153 + ], 154 + [ 155 + date143907, date141512, "negative 23 years and 7 months", 156 + ["years", -23, -7], 157 + ], 158 + [ 159 + date143907, date141507, "negative 24 years", 160 + ["years", -24, 0], 161 + ], 162 + [ 163 + date143703, date137702, "negative 60 years, 1 month", 164 + ["years", -60, -1], 165 + ], 166 + [ 167 + date143907, date143903, "negative 4 months", 168 + ["years", 0, -4], 169 + ], 170 + [ 171 + date143907, date143803, "negative 1 year, 4 months", 172 + ["years", -1, -4], 173 + ], 174 + [ 175 + date143907, date137803, "negative 61 years, 4 months", 176 + ["years", -61, -4], 177 + ], 178 + [ 179 + date143907, date143712, "negative 1 year, 7 months", 180 + ["years", -1, -7], 181 + ], 182 + [ 183 + date143907, date143812, "negative 7 months", 184 + ["years", 0, -7], 185 + ], 186 + [ 187 + date143907, date141512, "negative 23 years, 7 months", 188 + ["years", -23, -7], 189 + ], 190 + [ 191 + date143903, date143712, "negative 1 year, 3 months", 192 + ["years", -1, -3], 193 + ] 194 + ]; 195 + 196 + for (const [one, two, descr, ...units] of tests) { 197 + for (const [largestUnit, years, months] of units) { 198 + TemporalHelpers.assertDuration( 199 + one.until(two, { largestUnit }), 200 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 201 + descr 202 + ); 203 + } 204 + }
+204
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-islamic-umalqura.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (Islamic umalqura calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "islamic-umalqura"; 14 + 15 + // Years 16 + 17 + const date137702 = Temporal.PlainYearMonth.from({ year: 1377, monthCode: "M02", calendar }); 18 + const date137802 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M02", calendar }); 19 + const date137803 = Temporal.PlainYearMonth.from({ year: 1378, monthCode: "M03", calendar }); 20 + const date141507 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M07", calendar }); 21 + const date141512 = Temporal.PlainYearMonth.from({ year: 1415, monthCode: "M12", calendar }); 22 + const date141712 = Temporal.PlainYearMonth.from({ year: 1417, monthCode: "M12", calendar }); 23 + const date142106 = Temporal.PlainYearMonth.from({ year: 1421, monthCode: "M06", calendar }); 24 + const date143703 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M03", calendar }); 25 + const date143712 = Temporal.PlainYearMonth.from({ year: 1437, monthCode: "M12", calendar }); 26 + const date143803 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M03", calendar }); 27 + const date143812 = Temporal.PlainYearMonth.from({ year: 1438, monthCode: "M12", calendar }); 28 + const date143901 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M01", calendar }); 29 + const date143903 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M03", calendar });; 30 + const date143905 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M05", calendar }); 31 + const date143907 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M07", calendar }); 32 + const date143908 = Temporal.PlainYearMonth.from({ year: 1439, monthCode: "M08", calendar }); 33 + const date144007 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M07", calendar }); 34 + const date144009 = Temporal.PlainYearMonth.from({ year: 1440, monthCode: "M09", calendar }); 35 + const date144907 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M07", calendar }); 36 + const date144912 = Temporal.PlainYearMonth.from({ year: 1449, monthCode: "M12", calendar }); 37 + 38 + const tests = [ 39 + [ 40 + date143907, date143907, "same day", 41 + ["years", 0, 0], 42 + ["months", 0, 0], 43 + ], 44 + [ 45 + date143907, date143908, "1 month in same year", 46 + ["years", 0, 1], 47 + ["months", 0, 1], 48 + ], 49 + [ 50 + date143812, date143901, "1 month in different year", 51 + ["years", 0, 1], 52 + ["months", 0, 1], 53 + ], 54 + [ 55 + date143903, date143905, "2 months which both have 30 days", 56 + ["years", 0, 2], 57 + ["months", 0, 2], 58 + ], 59 + [ 60 + date143907, date144007, "1 year", 61 + ["years", 1, 0], 62 + ["months", 0, 12], 63 + ], 64 + [ 65 + date143907, date144907, "10 years", 66 + ["years", 10, 0], 67 + ["months", 0, 120], 68 + ], 69 + [ 70 + date143907, date144009, "1 year 2 months", 71 + ["years", 1, 2], 72 + ], 73 + [ 74 + date143907, date144912, "10 years and 5 months", 75 + ["years", 10, 5], 76 + ], 77 + [ 78 + date141512, date143907, "23 years and 7 months", 79 + ["years", 23, 7], 80 + ], 81 + [ 82 + date141507, date143907, "24 years", 83 + ["years", 24, 0], 84 + ], 85 + [ 86 + date137802, date143803, "60 years, 1 month", 87 + ["years", 60, 1], 88 + ], 89 + [ 90 + date143903, date143907, "4 months", 91 + ["years", 0, 4], 92 + ], 93 + [ 94 + date143803, date143907, "1 year, 4 months", 95 + ["years", 1, 4], 96 + ], 97 + [ 98 + date141712, date142106, "3 years, 6 months", 99 + ["years", 3, 6], 100 + ], 101 + [ 102 + date137803, date143907, "61 years, 4 months", 103 + ["years", 61, 4], 104 + ], 105 + [ 106 + date143712, date143907, "1 year, 7 months", 107 + ["years", 1, 7], 108 + ], 109 + [ 110 + date143812, date143907, "7 months", 111 + ["years", 0, 7], 112 + ], 113 + [ 114 + date141512, date143907, "23 years, 7 months", 115 + ["years", 23, 7], 116 + ], 117 + [ 118 + date143712, date143903, "1 year, 3 months", 119 + ["years", 1, 3], 120 + ], 121 + [ 122 + date143908, date143907, "negative 1 month in same year", 123 + ["years", 0, -1], 124 + ["months", 0, -1], 125 + ], 126 + [ 127 + date143901, date143812, "negative 1 month in different year", 128 + ["years", 0, -1], 129 + ["months", 0, -1], 130 + ], 131 + [ 132 + date143907, date143905, "negative 2 months which both have 30 days", 133 + ["years", 0, -2], 134 + ["months", 0, -2], 135 + ], 136 + [ 137 + date144007, date143907, "negative 1 year", 138 + ["years", -1, 0], 139 + ["months", 0, -12], 140 + ], 141 + [ 142 + date144907, date143907, "negative 10 years", 143 + ["years", -10, 0], 144 + ["months", 0, -120], 145 + ], 146 + [ 147 + date144009, date143907, "negative 1 year 2 months", 148 + ["years", -1, -2], 149 + ], 150 + [ 151 + date144912, date143907, "negative 10 years and 5 months", 152 + ["years", -10, -5], 153 + ], 154 + [ 155 + date143907, date141512, "negative 23 years and 7 months", 156 + ["years", -23, -7], 157 + ], 158 + [ 159 + date143907, date141507, "negative 24 years", 160 + ["years", -24, 0], 161 + ], 162 + [ 163 + date143703, date137702, "negative 60 years, 1 month", 164 + ["years", -60, -1], 165 + ], 166 + [ 167 + date143907, date143903, "negative 4 months", 168 + ["years", 0, -4], 169 + ], 170 + [ 171 + date143907, date143803, "negative 1 year, 4 months", 172 + ["years", -1, -4], 173 + ], 174 + [ 175 + date143907, date137803, "negative 61 years, 4 months", 176 + ["years", -61, -4], 177 + ], 178 + [ 179 + date143907, date143712, "negative 1 year, 7 months", 180 + ["years", -1, -7], 181 + ], 182 + [ 183 + date143907, date143812, "negative 7 months", 184 + ["years", 0, -7], 185 + ], 186 + [ 187 + date143907, date141512, "negative 23 years, 7 months", 188 + ["years", -23, -7], 189 + ], 190 + [ 191 + date143903, date143712, "negative 1 year, 3 months", 192 + ["years", -1, -3], 193 + ] 194 + ]; 195 + 196 + for (const [one, two, descr, ...units] of tests) { 197 + for (const [largestUnit, years, months] of units) { 198 + TemporalHelpers.assertDuration( 199 + one.until(two, { largestUnit }), 200 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 201 + descr 202 + ); 203 + } 204 + }
+211
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-japanese.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (japanese calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "japanese"; 14 + 15 + // Years 16 + 17 + const date196002 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M02", calendar }); 18 + const date196003 = Temporal.PlainYearMonth.from({ year: 1960, monthCode: "M03", calendar }); 19 + const date196907 = Temporal.PlainYearMonth.from({ year: 1969, monthCode: "M07", calendar }); 20 + const date199707 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M07", calendar }); 21 + const date199712 = Temporal.PlainYearMonth.from({ year: 1997, monthCode: "M12", calendar }); 22 + const date200106 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M06", calendar }); 23 + const date201907 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M07", calendar }); 24 + const date201912 = Temporal.PlainYearMonth.from({ year: 2019, monthCode: "M12", calendar }); 25 + const date202003 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M03", calendar }); 26 + const date202012 = Temporal.PlainYearMonth.from({ year: 2020, monthCode: "M12", calendar }); 27 + const date202101 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M01", calendar }); 28 + const date202103 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M03", calendar }); 29 + const date202107 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M07", calendar }); 30 + const date202108 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M08", calendar }); 31 + const date202109 = Temporal.PlainYearMonth.from({ year: 2021, monthCode: "M09", calendar }); 32 + const date202207 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M07", calendar }); 33 + const date202209 = Temporal.PlainYearMonth.from({ year: 2022, monthCode: "M09", calendar }); 34 + const date203107 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M07", calendar }); 35 + const date203112 = Temporal.PlainYearMonth.from({ year: 2031, monthCode: "M12", calendar }); 36 + 37 + const tests = [ 38 + [ 39 + date202107, date202107, "same day", 40 + ["years", 0, 0], 41 + ["months", 0, 0], 42 + ], 43 + [ 44 + date202107, date202108, "1 month in same year", 45 + ["years", 0, 1], 46 + ["months", 0, 1], 47 + ], 48 + [ 49 + date202012, date202101, "1 month in different year", 50 + ["years", 0, 1], 51 + ["months", 0, 1], 52 + ], 53 + [ 54 + date202107, date202109, "2 months which both have 31 days", 55 + ["years", 0, 2], 56 + ["months", 0, 2], 57 + ], 58 + [ 59 + date202107, date202207, "1 year", 60 + ["years", 1, 0], 61 + ["months", 0, 12], 62 + ], 63 + [ 64 + date202107, date203107, "10 years", 65 + ["years", 10, 0], 66 + ["months", 0, 120], 67 + ], 68 + [ 69 + date202107, date202209, "1 year 2 months", 70 + ["years", 1, 2], 71 + ], 72 + [ 73 + date202107, date203112, "10 years and 5 months", 74 + ["years", 10, 5], 75 + ], 76 + [ 77 + date199712, date202107, "23 years and 7 months", 78 + ["years", 23, 7], 79 + ], 80 + [ 81 + date199707, date202107, "24 years", 82 + ["years", 24, 0], 83 + ], 84 + [ 85 + date196002, date202003, "60 years, 1 month", 86 + ["years", 60, 1], 87 + ], 88 + [ 89 + date202103, date202107, "4 months", 90 + ["years", 0, 4], 91 + ], 92 + [ 93 + date202003, date202107, "1 year, 4 months", 94 + ["years", 1, 4], 95 + ], 96 + [ 97 + date199712, date200106, "3 years, 6 months", 98 + ["years", 3, 6], 99 + ], 100 + [ 101 + date196003, date202107, "61 years, 4 months", 102 + ["years", 61, 4], 103 + ], 104 + [ 105 + date201912, date202107, "1 year, 7 months", 106 + ["years", 1, 7], 107 + ], 108 + [ 109 + date202012, date202107, "7 months", 110 + ["years", 0, 7], 111 + ], 112 + [ 113 + date199712, date202107, "23 years, 7 months", 114 + ["years", 23, 7], 115 + ], 116 + [ 117 + date201912, date202103, "1 year, 3 months", 118 + ["years", 1, 3], 119 + ], 120 + [ 121 + date196907, date201907, "crossing epoch", 122 + ["years", 50, 0], 123 + ], 124 + [ 125 + date202108, date202107, "negative 1 month in same year", 126 + ["years", 0, -1], 127 + ["months", 0, -1], 128 + ], 129 + [ 130 + date202101, date202012, "negative 1 month in different year", 131 + ["years", 0, -1], 132 + ["months", 0, -1], 133 + ], 134 + [ 135 + date202109, date202107, "negative 2 months which both have 31 days", 136 + ["years", 0, -2], 137 + ["months", 0, -2], 138 + ], 139 + [ 140 + date202207, date202107, "negative 1 year", 141 + ["years", -1, 0], 142 + ["months", 0, -12], 143 + ], 144 + [ 145 + date203107, date202107, "negative 10 years", 146 + ["years", -10, 0], 147 + ["months", 0, -120], 148 + ], 149 + [ 150 + date202209, date202107, "negative 1 year 2 months", 151 + ["years", -1, -2], 152 + ], 153 + [ 154 + date203112, date202107, "negative 10 years and 5 months", 155 + ["years", -10, -5], 156 + ], 157 + [ 158 + date202107, date199712, "negative 23 years and 7 months", 159 + ["years", -23, -7], 160 + ], 161 + [ 162 + date202107, date199707, "negative 24 years", 163 + ["years", -24, 0], 164 + ], 165 + [ 166 + date202003, date196002, "negative 60 years, 1 month", 167 + ["years", -60, -1], 168 + ], 169 + [ 170 + date202107, date202103, "negative 4 months", 171 + ["years", 0, -4], 172 + ], 173 + [ 174 + date202107, date202003, "negative 1 year, 4 months", 175 + ["years", -1, -4], 176 + ], 177 + [ 178 + date202107, date196003, "negative 61 years, 4 months", 179 + ["years", -61, -4], 180 + ], 181 + [ 182 + date202107, date201912, "negative 1 year, 7 months", 183 + ["years", -1, -7], 184 + ], 185 + [ 186 + date202107, date202012, "negative 7 months", 187 + ["years", 0, -7], 188 + ], 189 + [ 190 + date202107, date199712, "negative 23 years, 7 months", 191 + ["years", -23, -7], 192 + ], 193 + [ 194 + date202103, date201912, "negative 1 year, 3 months", 195 + ["years", -1, -3], 196 + ], 197 + [ 198 + date201907, date196907, "crossing epoch", 199 + ["years", -50, 0], 200 + ], 201 + ]; 202 + 203 + for (const [one, two, descr, ...units] of tests) { 204 + for (const [largestUnit, years, months] of units) { 205 + TemporalHelpers.assertDuration( 206 + one.until(two, { largestUnit }), 207 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 208 + descr 209 + ); 210 + } 211 + }
+211
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-persian.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (Persian calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "persian"; 14 + 15 + // Years 16 + 17 + const date137512 = Temporal.PlainYearMonth.from({ year: 1375, monthCode: "M12", calendar }); 18 + const date137906 = Temporal.PlainYearMonth.from({ year: 1379, monthCode: "M06", calendar }); 19 + const date134202 = Temporal.PlainYearMonth.from({ year: 1342, monthCode: "M02", calendar }); 20 + const date134302 = Temporal.PlainYearMonth.from({ year: 1343, monthCode: "M02", calendar }); 21 + const date134303 = Temporal.PlainYearMonth.from({ year: 1343, monthCode: "M03", calendar }); 22 + const date138007 = Temporal.PlainYearMonth.from({ year: 1380, monthCode: "M07", calendar }); 23 + const date138012 = Temporal.PlainYearMonth.from({ year: 1380, monthCode: "M12", calendar }); 24 + const date140203 = Temporal.PlainYearMonth.from({ year: 1402, monthCode: "M03", calendar }); 25 + const date140212 = Temporal.PlainYearMonth.from({ year: 1402, monthCode: "M12", calendar }); 26 + const date140303 = Temporal.PlainYearMonth.from({ year: 1403, monthCode: "M03", calendar }); 27 + const date140312 = Temporal.PlainYearMonth.from({ year: 1403, monthCode: "M12", calendar }); 28 + const date140401 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M01", calendar }); 29 + const date140403 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M03", calendar }); 30 + const date140404 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M04", calendar }); 31 + const date140406 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M06", calendar }); 32 + const date140407 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M07", calendar }); 33 + const date140408 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M08", calendar }); 34 + const date140409 = Temporal.PlainYearMonth.from({ year: 1404, monthCode: "M09", calendar }); 35 + const date140507 = Temporal.PlainYearMonth.from({ year: 1405, monthCode: "M07", calendar }); 36 + const date140509 = Temporal.PlainYearMonth.from({ year: 1405, monthCode: "M09", calendar }); 37 + const date141407 = Temporal.PlainYearMonth.from({ year: 1414, monthCode: "M07", calendar }); 38 + const date141412 = Temporal.PlainYearMonth.from({ year: 1414, monthCode: "M12", calendar }); 39 + 40 + const tests = [ 41 + [ 42 + date140407, date140407, "same day", 43 + ["years", 0, 0], 44 + ["months", 0, 0], 45 + ], 46 + [ 47 + date140407, date140408, "1 month in same year", 48 + ["years", 0, 1], 49 + ["months", 0, 1], 50 + ], 51 + [ 52 + date140312, date140401, "1 month in different year", 53 + ["years", 0, 1], 54 + ["months", 0, 1], 55 + ], 56 + [ 57 + date140407, date140409, "2 months which both have 30 days", 58 + ["years", 0, 2], 59 + ["months", 0, 2], 60 + ], 61 + [ 62 + date140404, date140406, "2 months which both have 31 days", 63 + ["years", 0, 2], 64 + ["months", 0, 2], 65 + ], 66 + [ 67 + date140407, date140507, "1 year", 68 + ["years", 1, 0], 69 + ["months", 0, 12], 70 + ], 71 + [ 72 + date140407, date141407, "10 years", 73 + ["years", 10, 0], 74 + ["months", 0, 120], 75 + ], 76 + [ 77 + date140407, date140509, "1 year 2 months", 78 + ["years", 1, 2], 79 + ], 80 + [ 81 + date137512, date137906, "3 years, 6 months", 82 + ["years", 3, 6], 83 + ], 84 + [ 85 + date140407, date141412, "10 years and 5 months", 86 + ["years", 10, 5], 87 + ], 88 + [ 89 + date138012, date140407, "23 years and 7 months", 90 + ["years", 23, 7], 91 + ], 92 + [ 93 + date138007, date140407, "24 years", 94 + ["years", 24, 0], 95 + ], 96 + [ 97 + date134302, date140303, "60 years, 1 month", 98 + ["years", 60, 1], 99 + ], 100 + [ 101 + date140403, date140407, "4 months", 102 + ["years", 0, 4], 103 + ], 104 + [ 105 + date140303, date140407, "1 year, 4 months", 106 + ["years", 1, 4], 107 + ], 108 + [ 109 + date134303, date140407, "61 years, 4 months", 110 + ["years", 61, 4], 111 + ], 112 + [ 113 + date140212, date140407, "1 year, 7 months", 114 + ["years", 1, 7], 115 + ], 116 + [ 117 + date140312, date140407, "7 months", 118 + ["years", 0, 7], 119 + ], 120 + [ 121 + date138012, date140407, "23 years, 7 months", 122 + ["years", 23, 7], 123 + ], 124 + [ 125 + date140212, date140403, "1 year, 3 months", 126 + ["years", 1, 3], 127 + ], 128 + [ 129 + date140408, date140407, "negative 1 month in same year", 130 + ["years", 0, -1], 131 + ["months", 0, -1], 132 + ], 133 + [ 134 + date140401, date140312, "negative 1 month in different year", 135 + ["years", 0, -1], 136 + ["months", 0, -1], 137 + ], 138 + [ 139 + date140409, date140407, "negative 2 months which both have 30 days", 140 + ["years", 0, -2], 141 + ["months", 0, -2], 142 + ], 143 + [ 144 + date140507, date140407, "negative 1 year", 145 + ["years", -1, 0], 146 + ["months", 0, -12], 147 + ], 148 + [ 149 + date141407, date140407, "negative 10 years", 150 + ["years", -10, 0], 151 + ["months", 0, -120], 152 + ], 153 + [ 154 + date140509, date140407, "negative 1 year 2 months", 155 + ["years", -1, -2], 156 + ], 157 + [ 158 + date141412, date140407, "negative 10 years and 5 months", 159 + ["years", -10, -5], 160 + ], 161 + [ 162 + date140407, date138012, "negative 23 years and 7 months", 163 + ["years", -23, -7], 164 + ], 165 + [ 166 + date140407, date138007, "negative 24 years", 167 + ["years", -24, 0], 168 + ], 169 + [ 170 + date140203, date134202, "negative 60 years, 1 month", 171 + ["years", -60, -1], 172 + ], 173 + [ 174 + date140407, date140403, "negative 4 months", 175 + ["years", 0, -4], 176 + ], 177 + [ 178 + date140407, date140303, "negative 1 year, 4 months", 179 + ["years", -1, -4], 180 + ], 181 + [ 182 + date140407, date134303, "negative 61 years, 4 months", 183 + ["years", -61, -4], 184 + ], 185 + [ 186 + date140407, date140212, "negative 1 year, 7 months", 187 + ["years", -1, -7], 188 + ], 189 + [ 190 + date140407, date140312, "negative 7 months", 191 + ["years", 0, -7], 192 + ], 193 + [ 194 + date140407, date138012, "negative 23 years, 7 months", 195 + ["years", -23, -7], 196 + ], 197 + [ 198 + date140403, date140212, "negative 1 year, 3 months", 199 + ["years", -1, -3], 200 + ] 201 + ]; 202 + 203 + for (const [one, two, descr, ...units] of tests) { 204 + for (const [largestUnit, years, months] of units) { 205 + TemporalHelpers.assertDuration( 206 + one.until(two, { largestUnit }), 207 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 208 + descr 209 + ); 210 + } 211 + }
+211
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/basic-roc.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations not involving leap years or constraining 8 + (roc calendar) 9 + includes: [temporalHelpers.js] 10 + features: [Temporal, Intl.Era-monthcode] 11 + ---*/ 12 + 13 + const calendar = "roc"; 14 + 15 + // Years 16 + 17 + const date04902 = Temporal.PlainYearMonth.from({ year: 49, monthCode: "M02", calendar }); 18 + const date04903 = Temporal.PlainYearMonth.from({ year: 49, monthCode: "M03", calendar }); 19 + const date05807 = Temporal.PlainYearMonth.from({ year: 58, monthCode: "M07", calendar }); 20 + const date08607 = Temporal.PlainYearMonth.from({ year: 86, monthCode: "M07", calendar }); 21 + const date08612 = Temporal.PlainYearMonth.from({ year: 86, monthCode: "M12", calendar }); 22 + const date09006 = Temporal.PlainYearMonth.from({ year: 90, monthCode: "M06", calendar }); 23 + const date10807 = Temporal.PlainYearMonth.from({ year: 108, monthCode: "M07", calendar }); 24 + const date10812 = Temporal.PlainYearMonth.from({ year: 108, monthCode: "M12", calendar }); 25 + const date10903 = Temporal.PlainYearMonth.from({ year: 109, monthCode: "M03", calendar }); 26 + const date10912 = Temporal.PlainYearMonth.from({ year: 109, monthCode: "M12", calendar }); 27 + const date11001 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M01", calendar }); 28 + const date11003 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M03", calendar }); 29 + const date11007 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M07", calendar }); 30 + const date11008 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M08", calendar }); 31 + const date11009 = Temporal.PlainYearMonth.from({ year: 110, monthCode: "M09", calendar }); 32 + const date11107 = Temporal.PlainYearMonth.from({ year: 111, monthCode: "M07", calendar }); 33 + const date11109 = Temporal.PlainYearMonth.from({ year: 111, monthCode: "M09", calendar }); 34 + const date12007 = Temporal.PlainYearMonth.from({ year: 120, monthCode: "M07", calendar }); 35 + const date12012 = Temporal.PlainYearMonth.from({ year: 120, monthCode: "M12", calendar }); 36 + 37 + const tests = [ 38 + [ 39 + date11007, date11007, "same day", 40 + ["years", 0, 0], 41 + ["months", 0, 0], 42 + ], 43 + [ 44 + date11007, date11008, "1 month in same year", 45 + ["years", 0, 1], 46 + ["months", 0, 1], 47 + ], 48 + [ 49 + date10912, date11001, "1 month in different year", 50 + ["years", 0, 1], 51 + ["months", 0, 1], 52 + ], 53 + [ 54 + date11007, date11009, "2 months which both have 31 days", 55 + ["years", 0, 2], 56 + ["months", 0, 2], 57 + ], 58 + [ 59 + date11007, date11107, "1 year", 60 + ["years", 1, 0], 61 + ["months", 0, 12], 62 + ], 63 + [ 64 + date11007, date12007, "10 years", 65 + ["years", 10, 0], 66 + ["months", 0, 120], 67 + ], 68 + [ 69 + date11007, date11109, "1 year 2 months", 70 + ["years", 1, 2], 71 + ], 72 + [ 73 + date11007, date12012, "10 years and 5 months", 74 + ["years", 10, 5], 75 + ], 76 + [ 77 + date08612, date11007, "23 years and 7 months", 78 + ["years", 23, 7], 79 + ], 80 + [ 81 + date08607, date11007, "24 years", 82 + ["years", 24, 0], 83 + ], 84 + [ 85 + date04902, date10903, "60 years, 1 month", 86 + ["years", 60, 1], 87 + ], 88 + [ 89 + date11003, date11007, "4 months", 90 + ["years", 0, 4], 91 + ], 92 + [ 93 + date10903, date11007, "1 year, 4 months", 94 + ["years", 1, 4], 95 + ], 96 + [ 97 + date04903, date11007, "61 years, 4 months", 98 + ["years", 61, 4], 99 + ], 100 + [ 101 + date10812, date11007, "1 year, 7 months", 102 + ["years", 1, 7], 103 + ], 104 + [ 105 + date08612, date09006, "3 years, 6 months", 106 + ["years", 3, 6], 107 + ], 108 + [ 109 + date10912, date11007, "7 months", 110 + ["years", 0, 7], 111 + ], 112 + [ 113 + date08612, date11007, "23 years, 7 months", 114 + ["years", 23, 7], 115 + ], 116 + [ 117 + date10812, date11003, "1 year, 3 months", 118 + ["years", 1, 3], 119 + ], 120 + [ 121 + date05807, date10807, "crossing epoch", 122 + ["years", 50, 0], 123 + ], 124 + [ 125 + date11008, date11007, "negative 1 month in same year", 126 + ["years", 0, -1], 127 + ["months", 0, -1], 128 + ], 129 + [ 130 + date11001, date10912, "negative 1 month in different year", 131 + ["years", 0, -1], 132 + ["months", 0, -1], 133 + ], 134 + [ 135 + date11009, date11007, "negative 2 months which both have 31 days", 136 + ["years", 0, -2], 137 + ["months", 0, -2], 138 + ], 139 + [ 140 + date11107, date11007, "negative 1 year", 141 + ["years", -1, 0], 142 + ["months", 0, -12], 143 + ], 144 + [ 145 + date12007, date11007, "negative 10 years", 146 + ["years", -10, 0], 147 + ["months", 0, -120], 148 + ], 149 + [ 150 + date11109, date11007, "negative 1 year 2 months", 151 + ["years", -1, -2], 152 + ], 153 + [ 154 + date12012, date11007, "negative 10 years and 5 months", 155 + ["years", -10, -5], 156 + ], 157 + [ 158 + date11007, date08612, "negative 23 years and 7 months", 159 + ["years", -23, -7], 160 + ], 161 + [ 162 + date11007, date08607, "negative 24 years", 163 + ["years", -24, 0], 164 + ], 165 + [ 166 + date10903, date04902, "negative 60 years, 1 month", 167 + ["years", -60, -1], 168 + ], 169 + [ 170 + date11007, date11003, "negative 4 months", 171 + ["years", 0, -4], 172 + ], 173 + [ 174 + date11007, date10903, "negative 1 year, 4 months", 175 + ["years", -1, -4], 176 + ], 177 + [ 178 + date11007, date04903, "negative 61 years, 4 months", 179 + ["years", -61, -4], 180 + ], 181 + [ 182 + date11007, date10812, "negative 1 year, 7 months", 183 + ["years", -1, -7], 184 + ], 185 + [ 186 + date11007, date10912, "negative 7 months", 187 + ["years", 0, -7], 188 + ], 189 + [ 190 + date11007, date08612, "negative 23 years, 7 months", 191 + ["years", -23, -7], 192 + ], 193 + [ 194 + date11003, date10812, "negative 1 year, 3 months", 195 + ["years", -1, -3], 196 + ], 197 + [ 198 + date10807, date05807, "crossing epoch", 199 + ["years", -50, 0], 200 + ], 201 + ]; 202 + 203 + for (const [one, two, descr, ...units] of tests) { 204 + for (const [largestUnit, years, months] of units) { 205 + TemporalHelpers.assertDuration( 206 + one.until(two, { largestUnit }), 207 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 208 + descr 209 + ); 210 + } 211 + }
+12
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/calendar-mismatch.js
··· 1 + // Copyright (C) 2021 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: RangeError thrown if calendars' IDs do not match 7 + features: [Temporal] 8 + ---*/ 9 + 10 + const plainYearMonth1 = new Temporal.PlainYearMonth(2000, 1, "gregory", 1); 11 + const plainYearMonth2 = new Temporal.PlainYearMonth(2000, 1, "japanese", 1); 12 + assert.throws(RangeError, () => plainYearMonth1.until(plainYearMonth2));
+77
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/era-boundary-ethiopic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "ethiopic"; 12 + const options = { overflow: "reject" }; 13 + 14 + const aa5500 = Temporal.PlainYearMonth.from({ era: "aa", eraYear: 5500, monthCode: "M01", calendar }, options); 15 + const am1 = Temporal.PlainYearMonth.from({ era: "am", eraYear: 1, monthCode: "M01", calendar }, options); 16 + const am2000 = Temporal.PlainYearMonth.from({ era: "am", eraYear: 2000, monthCode: "M06", calendar }, options); 17 + const am2005 = Temporal.PlainYearMonth.from({ era: "am", eraYear: 2005, monthCode: "M06", calendar }, options); 18 + const aa5450 = Temporal.PlainYearMonth.from({ era: "aa", eraYear: 5450, monthCode: "M07", calendar }, options); 19 + const aa5455 = Temporal.PlainYearMonth.from({ era: "aa", eraYear: 5455, monthCode: "M07", calendar }, options); 20 + const am5 = Temporal.PlainYearMonth.from({ era: "am", eraYear: 5, monthCode: "M01", calendar }, options); 21 + 22 + const tests = [ 23 + // From 5500 AA to 1 AM 24 + [ 25 + aa5500, am1, 26 + [1, 0, "1y from 5500 AA to 1 AM"], 27 + [0, 13, "13mo from 5500 AA to 1 AM"], 28 + ], 29 + [ 30 + am1, aa5500, 31 + [-1, 0, "-1y backwards from 5500 AA to 1 AM"], 32 + [0, -13, "-13mo backwards from 1 AM to 5500 AA"], 33 + ], 34 + // From 2000 AM to 2005 AM 35 + [ 36 + am2000, am2005, 37 + [5, 0, "5y from 2000 AM to 2005 AM"], 38 + [0, 65, "65mo from 2000 AM to 2005 AM"], 39 + ], 40 + [ 41 + am2005, am2000, 42 + [-5, 0, "-5y backwards from 2000 AM to 2005 AM"], 43 + [0, -65, "-65mo backwards from 2000 AM to 2005 AM"], 44 + ], 45 + // From 5450 AA to 5455 AA 46 + [ 47 + aa5450, aa5455, 48 + [5, 0, "5y from 5450 AA to 5455 AA"], 49 + [0, 65, "65mo from 5450 AA to 5455 AA"], 50 + ], 51 + [ 52 + aa5455, aa5450, 53 + [-5, 0, "-5y backwards from 5450 AA to 5455 AA"], 54 + [0, -65, "-65mo backwards from 5450 AA to 5455 AA"], 55 + ], 56 + // From 5 AM to 5500 AA 57 + [ 58 + aa5500, am5, 59 + [5, 0, "5y from 5 AM to 5500 AA"], 60 + [0, 65, "65mo from 5 AM to 5500 AA"], 61 + ], 62 + [ 63 + am5, aa5500, 64 + [-5, 0, "-5y backwards from 5 AM to 5500 AA"], 65 + [0, -65, "-65mo backwards from 5 AM to 5500 AA"], 66 + ], 67 + ]; 68 + 69 + for (const [one, two, yearsTest, monthsTest] of tests) { 70 + let [years, months, descr] = yearsTest; 71 + let result = one.until(two, { largestUnit: "years" }); 72 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 73 + 74 + [years, months, descr] = monthsTest; 75 + result = one.until(two, { largestUnit: "months" }); 76 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 77 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/era-boundary-gregory.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "gregory"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bce5 = Temporal.PlainYearMonth.from({ era: "bce", eraYear: 5, monthCode: "M06", calendar }, options); 15 + const bce2 = Temporal.PlainYearMonth.from({ era: "bce", eraYear: 2, monthCode: "M12", calendar }, options); 16 + const bce1 = Temporal.PlainYearMonth.from({ era: "bce", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const ce1 = Temporal.PlainYearMonth.from({ era: "ce", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const ce2 = Temporal.PlainYearMonth.from({ era: "ce", eraYear: 2, monthCode: "M01", calendar }, options); 19 + const ce5 = Temporal.PlainYearMonth.from({ era: "ce", eraYear: 5, monthCode: "M06", calendar }, options); 20 + 21 + const tests = [ 22 + // From 5 BCE to 5 CE 23 + [ 24 + bce5, ce5, 25 + [9, 0, "9y from 5 BCE to 5 CE (no year 0)"], 26 + [0, 108, "108mo from 5 BCE to 5 CE (no year 0)"], 27 + ], 28 + [ 29 + ce5, bce5, 30 + [-9, 0, "-9y backwards from 5 BCE to 5 CE (no year 0)"], 31 + [0, -108, "-108mo backwards from 5 BCE to 5 CE (no year 0)"], 32 + ], 33 + // CE-BCE boundary 34 + [ 35 + bce1, ce1, 36 + [1, 0, "1y from 1 BCE to 1 CE"], 37 + [0, 12, "12mo from 1 BCE to 1 CE"], 38 + ], 39 + [ 40 + ce1, bce1, 41 + [-1, 0, "-1y backwards from 1 BCE to 1 CE"], 42 + [0, -12, "-12mo backwards from 1 BCE to 1 CE"], 43 + ], 44 + [ 45 + bce2, ce2, 46 + [2, 1, "2y 1mo from 2 BCE Dec to 2 CE Jan"], 47 + [0, 25, "25mo from 2 BCE Dec to 2 CE Jan"], 48 + ], 49 + [ 50 + ce2, bce2, 51 + [-2, -1, "-2y -1mo backwards from 2 BCE Dec to 2 CE Jan"], 52 + [0, -25, "-25mo backwards from 2 BCE Dec to 2 CE Jan"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.until(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.until(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/era-boundary-islamic-civil.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "islamic-civil"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bh5 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 5, monthCode: "M06", calendar }, options); 15 + const bh2 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 2, monthCode: "M12", calendar }, options); 16 + const bh1 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const ah1 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const ah2 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 2, monthCode: "M01", calendar }, options); 19 + const ah5 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 5, monthCode: "M06", calendar }, options); 20 + 21 + const tests = [ 22 + // From 5 BH to 5 AH 23 + [ 24 + bh5, ah5, 25 + [9, 0, "9y from 5 BH to 5 AH (no year 0)"], 26 + [0, 108, "108mo from 5 BH to 5 AH (no year 0)"], 27 + ], 28 + [ 29 + ah5, bh5, 30 + [-9, 0, "-9y backwards from 5 BH to 5 AH (no year 0)"], 31 + [0, -108, "-108mo backwards from 5 BH to 5 AH (no year 0)"], 32 + ], 33 + // AH-BH boundary 34 + [ 35 + bh1, ah1, 36 + [1, 0, "1y from 1 BH to 1 AH"], 37 + [0, 12, "12mo from 1 BH to 1 AH"], 38 + ], 39 + [ 40 + ah1, bh1, 41 + [-1, 0, "-1y backwards from 1 BH to 1 AH"], 42 + [0, -12, "-12mo backwards from 1 BH to 1 AH"], 43 + ], 44 + [ 45 + bh2, ah2, 46 + [2, 1, "2y 1mo from 2 BH Dec to 2 AH Jan"], 47 + [0, 25, "25mo from 2 BH Dec to 2 AH Jan"], 48 + ], 49 + [ 50 + ah2, bh2, 51 + [-2, -1, "-2y -1mo backwards from 2 BH Dec to 2 AH Jan"], 52 + [0, -25, "-25mo backwards from 2 BH Dec to 2 AH Jan"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.until(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.until(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/era-boundary-islamic-tbla.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "islamic-tbla"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bh5 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 5, monthCode: "M06", calendar }, options); 15 + const bh2 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 2, monthCode: "M12", calendar }, options); 16 + const bh1 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const ah1 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const ah2 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 2, monthCode: "M01", calendar }, options); 19 + const ah5 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 5, monthCode: "M06", calendar }, options); 20 + 21 + const tests = [ 22 + // From 5 BH to 5 AH 23 + [ 24 + bh5, ah5, 25 + [9, 0, "9y from 5 BH to 5 AH (no year 0)"], 26 + [0, 108, "108mo from 5 BH to 5 AH (no year 0)"], 27 + ], 28 + [ 29 + ah5, bh5, 30 + [-9, 0, "-9y backwards from 5 BH to 5 AH (no year 0)"], 31 + [0, -108, "-108mo backwards from 5 BH to 5 AH (no year 0)"], 32 + ], 33 + // AH-BH boundary 34 + [ 35 + bh1, ah1, 36 + [1, 0, "1y from 1 BH to 1 AH"], 37 + [0, 12, "12mo from 1 BH to 1 AH"], 38 + ], 39 + [ 40 + ah1, bh1, 41 + [-1, 0, "-1y backwards from 1 BH to 1 AH"], 42 + [0, -12, "-12mo backwards from 1 BH to 1 AH"], 43 + ], 44 + [ 45 + bh2, ah2, 46 + [2, 1, "2y 1mo from 2 BH Dec to 2 AH Jan"], 47 + [0, 25, "25mo from 2 BH Dec to 2 AH Jan"], 48 + ], 49 + [ 50 + ah2, bh2, 51 + [-2, -1, "-2y -1mo backwards from 2 BH Dec to 2 AH Jan"], 52 + [0, -25, "-25mo backwards from 2 BH Dec to 2 AH Jan"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.until(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.until(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/era-boundary-islamic-umalqura.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "islamic-umalqura"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bh5 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 5, monthCode: "M06", calendar }, options); 15 + const bh2 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 2, monthCode: "M12", calendar }, options); 16 + const bh1 = Temporal.PlainYearMonth.from({ era: "bh", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const ah1 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const ah2 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 2, monthCode: "M01", calendar }, options); 19 + const ah5 = Temporal.PlainYearMonth.from({ era: "ah", eraYear: 5, monthCode: "M06", calendar }, options); 20 + 21 + const tests = [ 22 + // From 5 BH to 5 AH 23 + [ 24 + bh5, ah5, 25 + [9, 0, "9y from 5 BH to 5 AH (no year 0)"], 26 + [0, 108, "108mo from 5 BH to 5 AH (no year 0)"], 27 + ], 28 + [ 29 + ah5, bh5, 30 + [-9, 0, "-9y backwards from 5 BH to 5 AH (no year 0)"], 31 + [0, -108, "-108mo backwards from 5 BH to 5 AH (no year 0)"], 32 + ], 33 + // AH-BH boundary 34 + [ 35 + bh1, ah1, 36 + [1, 0, "1y from 1 BH to 1 AH"], 37 + [0, 12, "12mo from 1 BH to 1 AH"], 38 + ], 39 + [ 40 + ah1, bh1, 41 + [-1, 0, "-1y backwards from 1 BH to 1 AH"], 42 + [0, -12, "-12mo backwards from 1 BH to 1 AH"], 43 + ], 44 + [ 45 + bh2, ah2, 46 + [2, 1, "2y 1mo from 2 BH Dec to 2 AH Jan"], 47 + [0, 25, "25mo from 2 BH Dec to 2 AH Jan"], 48 + ], 49 + [ 50 + ah2, bh2, 51 + [-2, -1, "-2y -1mo backwards from 2 BH Dec to 2 AH Jan"], 52 + [0, -25, "-25mo backwards from 2 BH Dec to 2 AH Jan"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.until(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.until(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+127
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/era-boundary-japanese.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "japanese"; 12 + const options = { overflow: "reject" }; 13 + 14 + const bce1 = Temporal.PlainYearMonth.from({ era: "bce", eraYear: 1, monthCode: "M06", calendar }, options); 15 + const ce1 = Temporal.PlainYearMonth.from({ era: "ce", eraYear: 1, monthCode: "M06", calendar }, options); 16 + const meiji5 = Temporal.PlainYearMonth.from({ era: "meiji", eraYear: 5, monthCode: "M01", calendar }, options); 17 + const meiji45 = Temporal.PlainYearMonth.from({ era: "meiji", eraYear: 45, monthCode: "M05", calendar }, options); 18 + const taisho1 = Temporal.PlainYearMonth.from({ era: "taisho", eraYear: 1, monthCode: "M08", calendar }, options); 19 + const taisho6 = Temporal.PlainYearMonth.from({ era: "taisho", eraYear: 6, monthCode: "M03", calendar }, options); 20 + const showa55 = Temporal.PlainYearMonth.from({ era: "showa", eraYear: 55, monthCode: "M03", calendar }, options); 21 + const showa64 = Temporal.PlainYearMonth.from({ era: "showa", eraYear: 64, monthCode: "M01", calendar }, options); 22 + const heisei1 = Temporal.PlainYearMonth.from({ era: "heisei", eraYear: 1, monthCode: "M02", calendar }, options); 23 + const heisei30 = Temporal.PlainYearMonth.from({ era: "heisei", eraYear: 30, monthCode: "M03", calendar }, options); 24 + const heisei31 = Temporal.PlainYearMonth.from({ era: "heisei", eraYear: 31, monthCode: "M04", calendar }, options); 25 + const reiwa1 = Temporal.PlainYearMonth.from({ era: "reiwa", eraYear: 1, monthCode: "M06", calendar }, options); 26 + const reiwa2 = Temporal.PlainYearMonth.from({ era: "reiwa", eraYear: 2, monthCode: "M03", calendar }, options); 27 + 28 + const tests = [ 29 + // From Heisei 30 (2018) to Reiwa 2 (2020) - crossing era boundary 30 + [ 31 + heisei30, reiwa2, 32 + [2, 0, "2y from Heisei 30 March to Reiwa 2 March"], 33 + [0, 24, "24mo from Heisei 30 March to Reiwa 2 March"], 34 + ], 35 + [ 36 + reiwa2, heisei30, 37 + [-2, 0, "-2y backwards from Heisei 30 March to Reiwa 2 March"], 38 + [0, -24, "-24mo backwards from Heisei 30 March to Reiwa 2 March"], 39 + ], 40 + // Within same year but different eras 41 + [ 42 + heisei31, reiwa1, 43 + [0, 2, "2mo from Heisei 31 April to Reiwa 1 June"], 44 + [0, 2, "2mo from Heisei 31 April to Reiwa 1 June"], 45 + ], 46 + [ 47 + reiwa1, heisei31, 48 + [0, -2, "-2mo backwards from Heisei 31 April to Reiwa 1 June"], 49 + [0, -2, "-2mo backwards from Heisei 31 April to Reiwa 1 June"], 50 + ], 51 + // From Showa 55 (1980) to Heisei 30 (2018) - crossing era boundary 52 + [ 53 + showa55, heisei30, 54 + [38, 0, "38y from Showa 55 March to Heisei 30 March"], 55 + [0, 456, "456mo from Showa 55 March to Heisei 30 March"], 56 + ], 57 + [ 58 + heisei30, showa55, 59 + [-38, 0, "-38y backwards from Showa 55 March to Heisei 30 March"], 60 + [0, -456, "-456mo backwards from Showa 55 March to Heisei 30 March"], 61 + ], 62 + // Within same year but different eras 63 + [ 64 + showa64, heisei1, 65 + [0, 1, "1mo from Showa 64 January to Heisei 1 February"], 66 + [0, 1, "1mo from Showa 64 January to Heisei 1 February"], 67 + ], 68 + [ 69 + heisei1, showa64, 70 + [0, -1, "-1mo from Showa 64 January to Heisei 1 February"], 71 + [0, -1, "-1mo from Showa 64 January to Heisei 1 February"], 72 + ], 73 + // From Taisho 6 (1917) to Showa 55 (1980) - crossing era boundary 74 + [ 75 + taisho6, showa55, 76 + [63, 0, "63y from Taisho 6 March to Showa 55 March"], 77 + [0, 756, "756mo from Taisho 6 March to Showa 55 March"], 78 + ], 79 + [ 80 + showa55, taisho6, 81 + [-63, 0, "-63y backwards from Taisho 6 March to Showa 55 March"], 82 + [0, -756, "-756mo backwards from Taisho 6 March to Showa 55 March"], 83 + ], 84 + // From Meiji 5 (1872) to Taisho 6 (1917) - crossing era boundary 85 + [ 86 + meiji5, taisho6, 87 + [45, 2, "45y 2mo from Meiji 5 January to Taisho 6 March"], 88 + [0, 542, "542mo from Meiji 5 January to Taisho 6 March"], 89 + ], 90 + [ 91 + taisho6, meiji5, 92 + [-45, -2, "-45y -2mo backwards from Meiji 5 January to Taisho 6 March"], 93 + [0, -542, "-542mo backwards from Meiji 5 January to Taisho 6 March"], 94 + ], 95 + // Within same year but different eras 96 + [ 97 + meiji45, taisho1, 98 + [0, 3, "3mo from Meiji 45 May to Taisho 1 August"], 99 + [0, 3, "3mo from Meiji 45 May to Taisho 1 August"], 100 + ], 101 + [ 102 + taisho1, meiji45, 103 + [0, -3, "-3mo backwards from Meiji 45 May to Taisho 1 August"], 104 + [0, -3, "-3mo backwards from Meiji 45 May to Taisho 1 August"], 105 + ], 106 + // CE-BCE boundary 107 + [ 108 + bce1, ce1, 109 + [1, 0, "1y from 1 BCE to 1 CE"], 110 + [0, 12, "12mo from 1 BCE to 1 CE"], 111 + ], 112 + [ 113 + ce1, bce1, 114 + [-1, 0, "-1y backwards from 1 BCE to 1 CE"], 115 + [0, -12, "-12mo backwards from 1 BCE to 1 CE"], 116 + ], 117 + ]; 118 + 119 + for (const [one, two, yearsTest, monthsTest] of tests) { 120 + let [years, months, descr] = yearsTest; 121 + let result = one.until(two, { largestUnit: "years" }); 122 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 123 + 124 + [years, months, descr] = monthsTest; 125 + result = one.until(two, { largestUnit: "months" }); 126 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 127 + }
+64
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/era-boundary-roc.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: Date difference works correctly across era boundaries 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + const calendar = "roc"; 12 + const options = { overflow: "reject" }; 13 + 14 + const broc5 = Temporal.PlainYearMonth.from({ era: "broc", eraYear: 5, monthCode: "M03", calendar }, options); 15 + const broc3 = Temporal.PlainYearMonth.from({ era: "broc", eraYear: 3, monthCode: "M01", calendar }, options); 16 + const broc1 = Temporal.PlainYearMonth.from({ era: "broc", eraYear: 1, monthCode: "M06", calendar }, options); 17 + const roc1 = Temporal.PlainYearMonth.from({ era: "roc", eraYear: 1, monthCode: "M06", calendar }, options); 18 + const roc5 = Temporal.PlainYearMonth.from({ era: "roc", eraYear: 5, monthCode: "M03", calendar }, options); 19 + const roc10 = Temporal.PlainYearMonth.from({ era: "roc", eraYear: 10, monthCode: "M01", calendar }, options); 20 + 21 + const tests = [ 22 + // From BROC 5 to ROC 5 23 + [ 24 + broc5, roc5, 25 + [9, 0, "9y from BROC 5 to ROC 5 (no year 0)"], 26 + [0, 108, "108mo from BROC 5 to ROC 5 (no year 0)"], 27 + ], 28 + [ 29 + roc5, broc5, 30 + [-9, 0, "-9y backwards from BROC 5 to ROC 5 (no year 0)"], 31 + [0, -108, "-108mo backwards from BROC 5 to ROC 5 (no year 0)"], 32 + ], 33 + // Era boundary 34 + [ 35 + broc1, roc1, 36 + [1, 0, "1y from BROC 1 to ROC 1"], 37 + [0, 12, "12mo from BROC 1 to ROC 1"], 38 + ], 39 + [ 40 + roc1, broc1, 41 + [-1, 0, "-1y backwards from BROC 1 to ROC 1"], 42 + [0, -12, "-12mo backwards from BROC 1 to ROC 1"], 43 + ], 44 + [ 45 + broc3, roc10, 46 + [12, 0, "12y from BROC 3 to ROC 10"], 47 + [0, 144, "144mo from BROC 3 to ROC 10"], 48 + ], 49 + [ 50 + roc10, broc3, 51 + [-12, 0, "-12y backwards from BROC 3 to ROC 10"], 52 + [0, -144, "-144mo backwards from BROC 3 to ROC 10"], 53 + ], 54 + ]; 55 + 56 + for (const [one, two, yearsTest, monthsTest] of tests) { 57 + let [years, months, descr] = yearsTest; 58 + let result = one.until(two, { largestUnit: "years" }); 59 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 60 + 61 + [years, months, descr] = monthsTest; 62 + result = one.until(two, { largestUnit: "months" }); 63 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 64 + }
+75
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/intercalary-month-coptic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations involving the intercalary month (coptic 8 + calendar) 9 + features: [Temporal, Intl.Era-monthcode] 10 + includes: [temporalHelpers.js] 11 + ---*/ 12 + 13 + const calendar = "coptic"; 14 + const options = { overflow: "reject" }; 15 + 16 + const commonM12 = Temporal.PlainYearMonth.from({ year: 1738, monthCode: "M12", calendar}, options); 17 + const commonIntercalary = Temporal.PlainYearMonth.from({ year: 1738, monthCode: "M13", calendar}, options); 18 + const leapFirst = Temporal.PlainYearMonth.from({ year: 1739, monthCode: "M01", calendar}, options); 19 + const leapM12 = Temporal.PlainYearMonth.from({ year: 1739, monthCode: "M12", calendar}, options); 20 + const leapIntercalary = Temporal.PlainYearMonth.from({ year: 1739, monthCode: "M13", calendar}, options); 21 + const common2First = Temporal.PlainYearMonth.from({ year: 1740, monthCode: "M01", calendar }, options); 22 + const common2Intercalary = Temporal.PlainYearMonth.from({ year: 1740, monthCode: "M13", calendar }, options); 23 + 24 + const tests = [ 25 + [ 26 + commonIntercalary, leapIntercalary, "last month of common year to last month of leap year", 27 + ["years", 1, 0], 28 + ["months", 0, 13], 29 + ], 30 + [ 31 + leapIntercalary, common2Intercalary, "last month of leap year to last month of common year", 32 + ["years", 1, 0], 33 + ["months", 0, 13], 34 + ], 35 + [ 36 + commonM12, leapFirst, "2mo passing through intercalary month in common year", 37 + ["years", 0, 2], 38 + ["months", 0, 2], 39 + ], 40 + [ 41 + leapM12, common2First, "2mo passing through intercalary month in leap year", 42 + ["years", 0, 2], 43 + ["months", 0, 2], 44 + ], 45 + [ 46 + common2Intercalary, leapIntercalary, "backwards last month of common year to last month of leap year", 47 + ["years", -1, 0], 48 + ["months", 0, -13], 49 + ], 50 + [ 51 + leapIntercalary, commonIntercalary, "backwards last month of leap year to last month of common year", 52 + ["years", -1, 0], 53 + ["months", 0, -13], 54 + ], 55 + [ 56 + leapFirst, commonM12, "backwards 2mo passing through intercalary month in common year", 57 + ["years", 0, -2], 58 + ["months", 0, -2], 59 + ], 60 + [ 61 + common2First, leapM12, "backwards 2mo passing through intercalary month in leap year", 62 + ["years", 0, -2], 63 + ["months", 0, -2], 64 + ], 65 + ]; 66 + 67 + for (const [one, two, descr, ...units] of tests) { 68 + for (const [largestUnit, years, months] of units) { 69 + TemporalHelpers.assertDuration( 70 + one.until(two, { largestUnit }), 71 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 72 + descr + ` (largest unit ${largestUnit})` 73 + ); 74 + } 75 + }
+75
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/intercalary-month-ethioaa.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations involving the intercalary month (ethioaa 8 + calendar) 9 + features: [Temporal, Intl.Era-monthcode] 10 + includes: [temporalHelpers.js] 11 + ---*/ 12 + 13 + const calendar = "ethioaa"; 14 + const options = { overflow: "reject" }; 15 + 16 + const commonM12 = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M12", calendar}, options); 17 + const commonIntercalary = Temporal.PlainYearMonth.from({ year: 7514, monthCode: "M13", calendar}, options); 18 + const leapFirst = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M01", calendar}, options); 19 + const leapM12 = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M12", calendar}, options); 20 + const leapIntercalary = Temporal.PlainYearMonth.from({ year: 7515, monthCode: "M13", calendar}, options); 21 + const common2First = Temporal.PlainYearMonth.from({ year: 7516, monthCode: "M01", calendar }, options); 22 + const common2Intercalary = Temporal.PlainYearMonth.from({ year: 7516, monthCode: "M13", calendar }, options); 23 + 24 + const tests = [ 25 + [ 26 + commonIntercalary, leapIntercalary, "last month of common year to last month of leap year", 27 + ["years", 1, 0], 28 + ["months", 0, 13], 29 + ], 30 + [ 31 + leapIntercalary, common2Intercalary, "last month of leap year to last month of common year", 32 + ["years", 1, 0], 33 + ["months", 0, 13], 34 + ], 35 + [ 36 + commonM12, leapFirst, "2mo passing through intercalary month in common year", 37 + ["years", 0, 2], 38 + ["months", 0, 2], 39 + ], 40 + [ 41 + leapM12, common2First, "2mo passing through intercalary month in leap year", 42 + ["years", 0, 2], 43 + ["months", 0, 2], 44 + ], 45 + [ 46 + common2Intercalary, leapIntercalary, "backwards last month of common year to last month of leap year", 47 + ["years", -1, 0], 48 + ["months", 0, -13], 49 + ], 50 + [ 51 + leapIntercalary, commonIntercalary, "backwards last month of leap year to last month of common year", 52 + ["years", -1, 0], 53 + ["months", 0, -13], 54 + ], 55 + [ 56 + leapFirst, commonM12, "backwards 2mo passing through intercalary month in common year", 57 + ["years", 0, -2], 58 + ["months", 0, -2], 59 + ], 60 + [ 61 + common2First, leapM12, "backwards 2mo passing through intercalary month in leap year", 62 + ["years", 0, -2], 63 + ["months", 0, -2], 64 + ], 65 + ]; 66 + 67 + for (const [one, two, descr, ...units] of tests) { 68 + for (const [largestUnit, years, months] of units) { 69 + TemporalHelpers.assertDuration( 70 + one.until(two, { largestUnit }), 71 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 72 + descr + ` (largest unit ${largestUnit})` 73 + ); 74 + } 75 + }
+75
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/intercalary-month-ethiopic.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.plainyearmonth.prototype.until 6 + description: > 7 + Check various basic calculations involving the intercalary month (ethiopic 8 + calendar) 9 + features: [Temporal, Intl.Era-monthcode] 10 + includes: [temporalHelpers.js] 11 + ---*/ 12 + 13 + const calendar = "ethiopic"; 14 + const options = { overflow: "reject" }; 15 + 16 + const commonM12 = Temporal.PlainYearMonth.from({ year: 2014, monthCode: "M12", calendar}, options); 17 + const commonIntercalary = Temporal.PlainYearMonth.from({ year: 2014, monthCode: "M13", calendar}, options); 18 + const leapFirst = Temporal.PlainYearMonth.from({ year: 2015, monthCode: "M01", calendar}, options); 19 + const leapM12 = Temporal.PlainYearMonth.from({ year: 2015, monthCode: "M12", calendar}, options); 20 + const leapIntercalary = Temporal.PlainYearMonth.from({ year: 2015, monthCode: "M13", calendar}, options); 21 + const common2First = Temporal.PlainYearMonth.from({ year: 2016, monthCode: "M01", calendar }, options); 22 + const common2Intercalary = Temporal.PlainYearMonth.from({ year: 2016, monthCode: "M13", calendar }, options); 23 + 24 + const tests = [ 25 + [ 26 + commonIntercalary, leapIntercalary, "last month of common year to last month of leap year", 27 + ["years", 1, 0], 28 + ["months", 0, 13], 29 + ], 30 + [ 31 + leapIntercalary, common2Intercalary, "last month of leap year to last month of common year", 32 + ["years", 1, 0], 33 + ["months", 0, 13], 34 + ], 35 + [ 36 + commonM12, leapFirst, "2mo passing through intercalary month in common year", 37 + ["years", 0, 2], 38 + ["months", 0, 2], 39 + ], 40 + [ 41 + leapM12, common2First, "2mo passing through intercalary month in leap year", 42 + ["years", 0, 2], 43 + ["months", 0, 2], 44 + ], 45 + [ 46 + common2Intercalary, leapIntercalary, "backwards last month of common year to last month of leap year", 47 + ["years", -1, 0], 48 + ["months", 0, -13], 49 + ], 50 + [ 51 + leapIntercalary, commonIntercalary, "backwards last month of leap year to last month of common year", 52 + ["years", -1, 0], 53 + ["months", 0, -13], 54 + ], 55 + [ 56 + leapFirst, commonM12, "backwards 2mo passing through intercalary month in common year", 57 + ["years", 0, -2], 58 + ["months", 0, -2], 59 + ], 60 + [ 61 + common2First, leapM12, "backwards 2mo passing through intercalary month in leap year", 62 + ["years", 0, -2], 63 + ["months", 0, -2], 64 + ], 65 + ]; 66 + 67 + for (const [one, two, descr, ...units] of tests) { 68 + for (const [largestUnit, years, months] of units) { 69 + TemporalHelpers.assertDuration( 70 + one.until(two, { largestUnit }), 71 + years, months, 0, 0, 0, 0, 0, 0, 0, 0, 72 + descr + ` (largest unit ${largestUnit})` 73 + ); 74 + } 75 + }
+149
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/leap-months-chinese.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + description: Difference across leap months in chinese calendar 6 + esid: sec-temporal.plainyearmonth.prototype.until 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + // 2001 is a leap year with a M04L leap month. 12 + 13 + const calendar = "chinese"; 14 + const options = { overflow: "reject" }; 15 + 16 + const common1Month4 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M04", calendar }, options); 17 + const common1Month5 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M05", calendar }, options); 18 + const common1Month6 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M06", calendar }, options); 19 + const leapMonth4 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M04", calendar }, options); 20 + const leapMonth4L = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M04L", calendar }, options); 21 + const leapMonth5 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M05", calendar }, options); 22 + const common2Month4 = Temporal.PlainYearMonth.from({ year: 2002, monthCode: "M04", calendar }, options); 23 + const common2Month5 = Temporal.PlainYearMonth.from({ year: 2002, monthCode: "M05", calendar }, options); 24 + 25 + // (receiver, argument, years test data, months test data) 26 + // test data: expected years, months, description 27 + // largestUnit years: make sure some cases where the answer is 12 months do not 28 + // balance up to 1 year 29 + // largestUnit months: similar to years, but make sure number of months in year 30 + // is computed correctly 31 + const tests = [ 32 + [ 33 + common1Month4, leapMonth4, 34 + [1, 0, "M04-M04 common-leap is 1y"], 35 + [0, 12, "M04-M04 common-leap is 12mo"], 36 + ], 37 + [ 38 + leapMonth4, common2Month4, 39 + [1, 0, "M04-M04 leap-common is 1y"], 40 + [0, 13, "M04-M04 leap-common is 13mo not 12mo"], 41 + ], 42 + [ 43 + common1Month4, common2Month4, 44 + [2, 0, "M04-M04 common-common is 2y"], 45 + [0, 25, "M04-M04 common-common is 25mo not 24mo"], 46 + ], 47 + [ 48 + common1Month5, leapMonth5, 49 + [1, 0, "M05-M05 common-leap is 1y"], 50 + [0, 13, "M05-M05 common-leap is 13mo not 12mo"], 51 + ], 52 + [ 53 + leapMonth5, common2Month5, 54 + [1, 0, "M05-M05 leap-common is 1y"], 55 + [0, 12, "M05-M05 leap-common is 12mo"], 56 + ], 57 + [ 58 + common1Month5, common2Month5, 59 + [2, 0, "M05-M05 common-common is 2y"], 60 + [0, 25, "M05-M05 common-common is 25mo not 24mo"], 61 + ], 62 + [ 63 + common1Month4, leapMonth4L, 64 + [1, 1, "M04-M04L is 1y 1mo"], 65 + [0, 13, "M04-M04L is 13mo"], 66 + ], 67 + [ 68 + leapMonth4L, common2Month4, 69 + [0, 12, "M04L-M04 is 12mo not 1y"], 70 + [0, 12, "M04L-M04 is 12mo"], 71 + ], 72 + [ 73 + common1Month5, leapMonth4L, 74 + [0, 12, "M05-M04L is 12mo not 1y"], 75 + [0, 12, "M05-M04L is 12mo"], 76 + ], 77 + [ 78 + leapMonth4L, common2Month5, 79 + [1, 1, "M04L-M05 is 1y 1mo (exhibits calendar-specific constraining)"], 80 + [0, 13, "M04L-M05 is 13mo"], 81 + ], 82 + [ 83 + common1Month6, leapMonth5, 84 + [0, 12, "M06-M05 common-leap is 12mo not 11mo"], 85 + [0, 12, "M06-M05 common-leap is 12mo not 11mo"], 86 + ], 87 + 88 + // Negative 89 + [ 90 + common2Month4, leapMonth4, 91 + [-1, 0, "M04-M04 common-leap backwards is -1y"], 92 + [0, -13, "M04-M04 common-leap backwards is -13mo not -12mo"], 93 + ], 94 + [ 95 + leapMonth4, common1Month4, 96 + [-1, 0, "M04-M04 leap-common backwards is -1y"], 97 + [0, -12, "M04-M04 leap-common backwards is -12mo not -13mo"], 98 + ], 99 + [ 100 + common2Month4, common1Month4, 101 + [-2, 0, "M04-M04 common-common backwards is -2y"], 102 + [0, -25, "M04-M04 common-common backwards is -25mo not -24mo"], 103 + ], 104 + [ 105 + common2Month5, leapMonth5, 106 + [-1, 0, "M05-M05 common-leap backwards is -1y"], 107 + [0, -12, "M05-M05 common-leap backwards is -12mo not -13mo"], 108 + ], 109 + [ 110 + leapMonth5, common1Month5, 111 + [-1, 0, "M05-M05 leap-common backwards is -1y"], 112 + [0, -13, "M05-M05 leap-common backwards is -13mo not -12mo"], 113 + ], 114 + [ 115 + common2Month5, common1Month5, 116 + [-2, 0, "M05-M05 common-common backwards is -2y"], 117 + [0, -25, "M05-M05 common-common backwards is -25mo not -24mo"], 118 + ], 119 + [ 120 + common2Month4, leapMonth4L, 121 + [0, -12, "M04-M04L backwards is -12mo not -1y"], 122 + [0, -12, "M04-M04L backwards is -12mo"], 123 + ], 124 + [ 125 + leapMonth4L, common1Month4, 126 + [-1, 0, "M04L-M04 backwards is -1y not -1y -1mo (exhibits calendar-specific constraining)"], 127 + [0, -13, "M04L-M04 backwards is -13mo"], 128 + ], 129 + [ 130 + common2Month5, leapMonth4L, 131 + [-1, -1, "M05-M04L backwards is -1y -1mo"], 132 + [0, -13, "M05-M04L backwards is -13mo"], 133 + ], 134 + [ 135 + leapMonth4L, common1Month5, 136 + [0, -12, "M04L-M05 backwards is -12mo not -1y"], 137 + [0, -12, "M04L-M05 backwards is -12mo"], 138 + ], 139 + ]; 140 + 141 + for (const [one, two, yearsTest, monthsTest] of tests) { 142 + let [years, months, descr] = yearsTest; 143 + let result = one.until(two, { largestUnit: "years" }); 144 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 145 + 146 + [years, months, descr] = monthsTest; 147 + result = one.until(two, { largestUnit: "months" }); 148 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 149 + }
+149
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/leap-months-dangi.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + description: Difference across leap months in dangi calendar 6 + esid: sec-temporal.plainyearmonth.prototype.until 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + // 2001 is a leap year with a M04L leap month. 12 + 13 + const calendar = "dangi"; 14 + const options = { overflow: "reject" }; 15 + 16 + const common1Month4 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M04", calendar }, options); 17 + const common1Month5 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M05", calendar }, options); 18 + const common1Month6 = Temporal.PlainYearMonth.from({ year: 2000, monthCode: "M06", calendar }, options); 19 + const leapMonth4 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M04", calendar }, options); 20 + const leapMonth4L = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M04L", calendar }, options); 21 + const leapMonth5 = Temporal.PlainYearMonth.from({ year: 2001, monthCode: "M05", calendar }, options); 22 + const common2Month4 = Temporal.PlainYearMonth.from({ year: 2002, monthCode: "M04", calendar }, options); 23 + const common2Month5 = Temporal.PlainYearMonth.from({ year: 2002, monthCode: "M05", calendar }, options); 24 + 25 + // (receiver, argument, years test data, months test data) 26 + // test data: expected years, months, description 27 + // largestUnit years: make sure some cases where the answer is 12 months do not 28 + // balance up to 1 year 29 + // largestUnit months: similar to years, but make sure number of months in year 30 + // is computed correctly 31 + const tests = [ 32 + [ 33 + common1Month4, leapMonth4, 34 + [1, 0, "M04-M04 common-leap is 1y"], 35 + [0, 12, "M04-M04 common-leap is 12mo"], 36 + ], 37 + [ 38 + leapMonth4, common2Month4, 39 + [1, 0, "M04-M04 leap-common is 1y"], 40 + [0, 13, "M04-M04 leap-common is 13mo not 12mo"], 41 + ], 42 + [ 43 + common1Month4, common2Month4, 44 + [2, 0, "M04-M04 common-common is 2y"], 45 + [0, 25, "M04-M04 common-common is 25mo not 24mo"], 46 + ], 47 + [ 48 + common1Month5, leapMonth5, 49 + [1, 0, "M05-M05 common-leap is 1y"], 50 + [0, 13, "M05-M05 common-leap is 13mo not 12mo"], 51 + ], 52 + [ 53 + leapMonth5, common2Month5, 54 + [1, 0, "M05-M05 leap-common is 1y"], 55 + [0, 12, "M05-M05 leap-common is 12mo"], 56 + ], 57 + [ 58 + common1Month5, common2Month5, 59 + [2, 0, "M05-M05 common-common is 2y"], 60 + [0, 25, "M05-M05 common-common is 25mo not 24mo"], 61 + ], 62 + [ 63 + common1Month4, leapMonth4L, 64 + [1, 1, "M04-M04L is 1y 1mo"], 65 + [0, 13, "M04-M04L is 13mo"], 66 + ], 67 + [ 68 + leapMonth4L, common2Month4, 69 + [0, 12, "M04L-M04 is 12mo not 1y"], 70 + [0, 12, "M04L-M04 is 12mo"], 71 + ], 72 + [ 73 + common1Month5, leapMonth4L, 74 + [0, 12, "M05-M04L is 12mo not 1y"], 75 + [0, 12, "M05-M04L is 12mo"], 76 + ], 77 + [ 78 + leapMonth4L, common2Month5, 79 + [1, 1, "M04L-M05 is 1y 1mo (exhibits calendar-specific constraining)"], 80 + [0, 13, "M04L-M05 is 13mo"], 81 + ], 82 + [ 83 + common1Month6, leapMonth5, 84 + [0, 12, "M06-M05 common-leap is 12mo not 11mo"], 85 + [0, 12, "M06-M05 common-leap is 12mo not 11mo"], 86 + ], 87 + 88 + // Negative 89 + [ 90 + common2Month4, leapMonth4, 91 + [-1, 0, "M04-M04 common-leap backwards is -1y"], 92 + [0, -13, "M04-M04 common-leap backwards is -13mo not -12mo"], 93 + ], 94 + [ 95 + leapMonth4, common1Month4, 96 + [-1, 0, "M04-M04 leap-common backwards is -1y"], 97 + [0, -12, "M04-M04 leap-common backwards is -12mo not -13mo"], 98 + ], 99 + [ 100 + common2Month4, common1Month4, 101 + [-2, 0, "M04-M04 common-common backwards is -2y"], 102 + [0, -25, "M04-M04 common-common backwards is -25mo not -24mo"], 103 + ], 104 + [ 105 + common2Month5, leapMonth5, 106 + [-1, 0, "M05-M05 common-leap backwards is -1y"], 107 + [0, -12, "M05-M05 common-leap backwards is -12mo not -13mo"], 108 + ], 109 + [ 110 + leapMonth5, common1Month5, 111 + [-1, 0, "M05-M05 leap-common backwards is -1y"], 112 + [0, -13, "M05-M05 leap-common backwards is -13mo not -12mo"], 113 + ], 114 + [ 115 + common2Month5, common1Month5, 116 + [-2, 0, "M05-M05 common-common backwards is -2y"], 117 + [0, -25, "M05-M05 common-common backwards is -25mo not -24mo"], 118 + ], 119 + [ 120 + common2Month4, leapMonth4L, 121 + [0, -12, "M04-M04L backwards is -12mo not -1y"], 122 + [0, -12, "M04-M04L backwards is -12mo"], 123 + ], 124 + [ 125 + leapMonth4L, common1Month4, 126 + [-1, 0, "M04L-M04 backwards is -1y not -1y -1mo (exhibits calendar-specific constraining)"], 127 + [0, -13, "M04L-M04 backwards is -13mo"], 128 + ], 129 + [ 130 + common2Month5, leapMonth4L, 131 + [-1, -1, "M05-M04L backwards is -1y -1mo"], 132 + [0, -13, "M05-M04L backwards is -13mo"], 133 + ], 134 + [ 135 + leapMonth4L, common1Month5, 136 + [0, -12, "M04L-M05 backwards is -12mo not -1y"], 137 + [0, -12, "M04L-M05 backwards is -12mo"], 138 + ], 139 + ]; 140 + 141 + for (const [one, two, yearsTest, monthsTest] of tests) { 142 + let [years, months, descr] = yearsTest; 143 + let result = one.until(two, { largestUnit: "years" }); 144 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 145 + 146 + [years, months, descr] = monthsTest; 147 + result = one.until(two, { largestUnit: "months" }); 148 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 149 + }
+153
vendor/git/test262/test/intl402/Temporal/PlainYearMonth/prototype/until/leap-months-hebrew.js
··· 1 + // Copyright (C) 2025 Igalia, S.L. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + description: Difference across leap months in hebrew calendar 6 + esid: sec-temporal.plainyearmonth.prototype.until 7 + includes: [temporalHelpers.js] 8 + features: [Temporal, Intl.Era-monthcode] 9 + ---*/ 10 + 11 + // 5784 is a leap year. 12 + // M05 - Shevat 13 + // M05L - Adar I 14 + // M06 - Adar II 15 + // M07 - Nisan 16 + 17 + const calendar = "hebrew"; 18 + const options = { overflow: "reject" }; 19 + 20 + const common1Shevat = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M05", calendar }, options); 21 + const common1Adar = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M06", calendar }, options); 22 + const common1Nisan = Temporal.PlainYearMonth.from({ year: 5783, monthCode: "M07", calendar }, options); 23 + const leapShevat = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M05", calendar }, options); 24 + const leapAdarI = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M05L", calendar }, options); 25 + const leapAdarII = Temporal.PlainYearMonth.from({ year: 5784, monthCode: "M06", calendar }, options); 26 + const common2Shevat = Temporal.PlainYearMonth.from({ year: 5785, monthCode: "M05", calendar }, options); 27 + const common2Adar = Temporal.PlainYearMonth.from({ year: 5785, monthCode: "M06", calendar }, options); 28 + 29 + // (receiver, argument, years test data, months test data) 30 + // test data: expected years, months, description 31 + // largestUnit years: make sure some cases where the answer is 12 months do not 32 + // balance up to 1 year 33 + // largestUnit months: similar to years, but make sure number of months in year 34 + // is computed correctly 35 + const tests = [ 36 + [ 37 + common1Shevat, leapShevat, 38 + [1, 0, "M05-M05 common-leap is 1y"], 39 + [0, 12, "M05-M05 common-leap is 12mo"], 40 + ], 41 + [ 42 + leapShevat, common2Shevat, 43 + [1, 0, "M05-M05 leap-common is 1y"], 44 + [0, 13, "M05-M05 leap-common is 13mo not 12mo"], 45 + ], 46 + [ 47 + common1Shevat, common2Shevat, 48 + [2, 0, "M05-M05 common-common is 2y"], 49 + [0, 25, "M05-M05 common-common is 25mo not 24mo"], 50 + ], 51 + [ 52 + common1Adar, leapAdarII, 53 + [1, 0, "M06-M06 common-leap is 1y"], 54 + [0, 13, "M06-M06 common-leap is 13mo not 12mo"], 55 + ], 56 + [ 57 + leapAdarII, common2Adar, 58 + [1, 0, "M06-M06 leap-common is 1y"], 59 + [0, 12, "M06-M06 leap-common is 12mo"], 60 + ], 61 + [ 62 + common1Adar, common2Adar, 63 + [2, 0, "M06-M06 common-common is 2y"], 64 + [0, 25, "M06-M06 common-common is 25mo not 24mo"], 65 + ], 66 + [ 67 + common1Shevat, leapAdarI, 68 + [1, 1, "M05-M05L is 1y 1mo"], 69 + [0, 13, "M05-M05L is 13mo"], 70 + ], 71 + [ 72 + leapAdarI, common2Shevat, 73 + [0, 12, "M05L-M05 is 12mo not 1y"], 74 + [0, 12, "M05L-M05 is 12mo"], 75 + ], 76 + [ 77 + common1Adar, leapAdarI, 78 + [0, 12, "M06-M05L is 12mo not 1y"], 79 + [0, 12, "M06-M05L is 12mo"], 80 + ], 81 + [ 82 + leapAdarI, common2Adar, 83 + [1, 0, "M05L-M06 is 1y (exhibits calendar-specific constraining)"], 84 + [0, 13, "M05L-M06 is 13mo"], 85 + ], 86 + [ 87 + common1Nisan, leapAdarII, 88 + [0, 12, "M07-M06 common-leap is 12mo not 11mo"], 89 + [0, 12, "M07-M06 common-leap is 12mo not 11mo"], 90 + ], 91 + 92 + // Negative 93 + [ 94 + common2Shevat, leapShevat, 95 + [-1, 0, "M05-M05 common-leap backwards is -1y"], 96 + [0, -13, "M05-M05 common-leap backwards is -13mo not -12mo"], 97 + ], 98 + [ 99 + leapShevat, common1Shevat, 100 + [-1, 0, "M05-M05 leap-common backwards is -1y"], 101 + [0, -12, "M05-M05 leap-common backwards is -12mo not -13mo"], 102 + ], 103 + [ 104 + common2Shevat, common1Shevat, 105 + [-2, 0, "M05-M05 common-common backwards is -2y"], 106 + [0, -25, "M05-M05 common-common backwards is -25mo not -24mo"], 107 + ], 108 + [ 109 + common2Adar, leapAdarII, 110 + [-1, 0, "M06-M06 common-leap backwards is -1y"], 111 + [0, -12, "M06-M06 common-leap backwards is -12mo not -13mo"], 112 + ], 113 + [ 114 + leapAdarII, common1Adar, 115 + [-1, 0, "M06-M06 leap-common backwards is -1y"], 116 + [0, -13, "M06-M06 leap-common backwards is -13mo not -12mo"], 117 + ], 118 + [ 119 + common2Adar, common1Adar, 120 + [-2, 0, "M06-M06 common-common backwards is -2y"], 121 + [0, -25, "M06-M06 common-common backwards is -25mo not -24mo"], 122 + ], 123 + [ 124 + common2Shevat, leapAdarI, 125 + [0, -12, "M05-M05L backwards is -12mo not -1y"], 126 + [0, -12, "M05-M05L backwards is -12mo"], 127 + ], 128 + [ 129 + leapAdarI, common1Shevat, 130 + [-1, -1, "M05L-M05 backwards is -1y -1mo (exhibits calendar-specific constraining)"], 131 + [0, -13, "M05L-M05 backwards is -13mo"], 132 + ], 133 + [ 134 + common2Adar, leapAdarI, 135 + [-1, -1, "M06-M05L backwards is -1y -1mo"], 136 + [0, -13, "M06-M05L backwards is -13mo"], 137 + ], 138 + [ 139 + leapAdarI, common1Adar, 140 + [0, -12, "M05L-M06 backwards is -12mo not -1y"], 141 + [0, -12, "M05L-M06 backwards is -12mo"], 142 + ], 143 + ]; 144 + 145 + for (const [one, two, yearsTest, monthsTest] of tests) { 146 + let [years, months, descr] = yearsTest; 147 + let result = one.until(two, { largestUnit: "years" }); 148 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 149 + 150 + [years, months, descr] = monthsTest; 151 + result = one.until(two, { largestUnit: "months" }); 152 + TemporalHelpers.assertDuration(result, years, months, 0, 0, 0, 0, 0, 0, 0, 0, descr); 153 + }