[
{ "name": "a 14 day trial from 1 January is free to the 14th and charged on the 15th", "args": ["2026-01-01", 14], "expect": { "lastTrialDay": "2026-01-14", "firstChargeDate": "2026-01-15" } },
{ "name": "a trial crossing the end of February in an ordinary year", "args": ["2026-02-15", 14], "expect": { "lastTrialDay": "2026-02-28", "firstChargeDate": "2026-03-01" } },
{ "name": "the same trial in a leap year is charged on 29 February", "args": ["2024-02-15", 14], "expect": { "lastTrialDay": "2024-02-28", "firstChargeDate": "2024-02-29" } },
{ "name": "a trial ending on New Year's Eve is charged in the next year", "args": ["2026-12-25", 7], "expect": { "lastTrialDay": "2026-12-31", "firstChargeDate": "2027-01-01" } },
{ "name": "30 days from 31 January is 1 March, not 'a month later' on 28 February", "args": ["2026-01-31", 30], "expect": { "lastTrialDay": "2026-03-01", "firstChargeDate": "2026-03-02" } },
{ "name": "a one day trial is free on the start day only", "args": ["2026-09-23", 1], "expect": { "lastTrialDay": "2026-09-23", "firstChargeDate": "2026-09-24" } },
{ "name": "no trial: nothing is free and the charge is on the start date", "args": ["2026-09-23", 0], "expect": { "lastTrialDay": null, "firstChargeDate": "2026-09-23" } },
{ "name": "a 365 day trial that does not cross a 29 February", "args": ["2024-03-01", 365], "expect": { "lastTrialDay": "2025-02-28", "firstChargeDate": "2025-03-01" } },
{ "name": "a 365 day trial that crosses 29 February ends a day short of the anniversary", "args": ["2023-03-01", 365], "expect": { "lastTrialDay": "2024-02-28", "firstChargeDate": "2024-02-29" } },
{ "name": "a negative trial length is an error", "args": ["2026-01-01", -1], "expectError": "trial days must not be negative" },
{ "name": "an impossible start date is an error, even with no trial", "args": ["2026-02-30", 0], "expectError": "is not a real calendar date" },
{ "name": "a start date that is not ISO is an error", "args": ["01/02/2026", 14], "expectError": "is not an ISO date" }
]