[ { "name": "6 April is the first day of the new tax year", "args": ["2026-04-06"], "expect": { "start": "2026-04-06", "end": "2027-04-05", "label": "2026/27" } }, { "name": "5 April is the last day of the old one", "args": ["2026-04-05"], "expect": { "start": "2025-04-06", "end": "2026-04-05", "label": "2025/26" } }, { "name": "4 April is still the old tax year", "args": ["2026-04-04"], "expect": { "start": "2025-04-06", "end": "2026-04-05", "label": "2025/26" } }, { "name": "7 April is comfortably in the new one", "args": ["2026-04-07"], "expect": { "start": "2026-04-06", "end": "2027-04-05", "label": "2026/27" } }, { "name": "1 April is the company year end, not the personal tax year", "args": ["2026-04-01"], "expect": { "start": "2025-04-06", "end": "2026-04-05", "label": "2025/26" } }, { "name": "31 March is in the tax year that ends the following week", "args": ["2026-03-31"], "expect": { "start": "2025-04-06", "end": "2026-04-05", "label": "2025/26" } }, { "name": "January falls in the tax year that started the previous April", "args": ["2026-01-01"], "expect": { "start": "2025-04-06", "end": "2026-04-05", "label": "2025/26" } }, { "name": "New Year's Eve is in the tax year that started that April", "args": ["2026-12-31"], "expect": { "start": "2026-04-06", "end": "2027-04-05", "label": "2026/27" } }, { "name": "a leap day resolves like any other February date", "args": ["2024-02-29"], "expect": { "start": "2023-04-06", "end": "2024-04-05", "label": "2023/24" } }, { "name": "the label rolls over the century correctly", "args": ["1999-04-06"], "expect": { "start": "1999-04-06", "end": "2000-04-05", "label": "1999/00" } }, { "name": "the day before that century rollover", "args": ["1999-04-05"], "expect": { "start": "1998-04-06", "end": "1999-04-05", "label": "1998/99" } }, { "name": "the year 2000 label is 2000/01, not 2000/1", "args": ["2000-04-06"], "expect": { "start": "2000-04-06", "end": "2001-04-05", "label": "2000/01" } }, { "name": "a date in the 2000/01 year before its April start", "args": ["2001-02-28"], "expect": { "start": "2000-04-06", "end": "2001-04-05", "label": "2000/01" } }, { "name": "a tax year spanning a leap year ends on 5 April as always", "args": ["2024-04-06"], "expect": { "start": "2024-04-06", "end": "2025-04-05", "label": "2024/25" } }, { "name": "a slash-separated date is an error, not a guess", "args": ["06/04/2026"], "expectError": "is not an ISO date" }, { "name": "an unpadded day is an error", "args": ["2026-04-6"], "expectError": "is not an ISO date" }, { "name": "30 February is not a real date", "args": ["2026-02-30"], "expectError": "is not a real calendar date" }, { "name": "31 April is not a real date", "args": ["2026-04-31"], "expectError": "is not a real calendar date" }, { "name": "a date whose tax year would start before year 1 is out of range", "args": ["0001-01-01"], "expectError": "outside the supported range" } ]