[ { "name": "ACT/365F over half of 2026: 181 actual days", "args": ["2026-01-01", "2026-07-01", "act-365f"], "expect": { "numerator": 181, "denominator": 365 } }, { "name": "ACT/360 over the same 181 days", "args": ["2026-01-01", "2026-07-01", "act-360"], "expect": { "numerator": 181, "denominator": 360 } }, { "name": "ACT/360 over 90 days is exactly a quarter, reduced to lowest terms", "args": ["2026-01-01", "2026-04-01", "act-360"], "expect": { "numerator": 1, "denominator": 4 } }, { "name": "ACT/365F over a whole leap year is 366/365, more than one", "args": ["2024-01-01", "2025-01-01", "act-365f"], "expect": { "numerator": 366, "denominator": 365 } }, { "name": "ACT/365F across 29 February from the last day of 2023", "args": ["2023-12-31", "2024-12-31", "act-365f"], "expect": { "numerator": 366, "denominator": 365 } }, { "name": "30/360 bond basis: 31 Jan to 28 Feb, D1 becomes 30, so 28 days", "args": ["2026-01-31", "2026-02-28", "30-360"], "expect": { "numerator": 7, "denominator": 90 } }, { "name": "30/360 bond basis: 31 Jan to 31 Mar, both ends trimmed, 60 days", "args": ["2026-01-31", "2026-03-31", "30-360"], "expect": { "numerator": 1, "denominator": 6 } }, { "name": "30/360 bond basis keeps D2 = 31 when D1 is not at month end: 76 days", "args": ["2026-01-15", "2026-03-31", "30-360"], "expect": { "numerator": 19, "denominator": 90 } }, { "name": "30E/360 always trims D2 = 31: the same dates give 75 days", "args": ["2026-01-15", "2026-03-31", "30e-360"], "expect": { "numerator": 5, "denominator": 24 } }, { "name": "30E/360 31 Jan to 31 Mar", "args": ["2026-01-31", "2026-03-31", "30e-360"], "expect": { "numerator": 1, "denominator": 6 } }, { "name": "30/360 has no end-of-February rule: 28 Feb to 1 Mar is 3 days, not 1", "args": ["2026-02-28", "2026-03-01", "30-360"], "expect": { "numerator": 1, "denominator": 120 } }, { "name": "30/360 over a whole year is exactly 1", "args": ["2025-03-15", "2026-03-15", "30-360"], "expect": { "numerator": 1, "denominator": 1 } }, { "name": "ACT/ACT ISDA splits the days by year: 184/365 + 182/366", "args": ["2023-07-01", "2024-07-01", "act-act-isda"], "expect": { "numerator": 66887, "denominator": 66795 } }, { "name": "ACT/ACT ISDA over a whole leap year is exactly 1", "args": ["2024-01-01", "2025-01-01", "act-act-isda"], "expect": { "numerator": 1, "denominator": 1 } }, { "name": "ACT/ACT ISDA over two whole years is exactly 2", "args": ["2024-01-01", "2026-01-01", "act-act-isda"], "expect": { "numerator": 2, "denominator": 1 } }, { "name": "ACT/ACT ISDA within one ordinary year", "args": ["2026-01-01", "2026-07-01", "act-act-isda"], "expect": { "numerator": 181, "denominator": 365 } }, { "name": "ACT/ACT ISDA within one leap year", "args": ["2024-01-01", "2024-07-01", "act-act-isda"], "expect": { "numerator": 91, "denominator": 183 } }, { "name": "the same date twice is zero, as 0/1", "args": ["2026-09-22", "2026-09-22", "act-360"], "expect": { "numerator": 0, "denominator": 1 } }, { "name": "a start after the end is an error", "args": ["2026-09-23", "2026-09-22", "act-365f"], "expectError": "must not be after endIso" }, { "name": "an unknown convention is an error, not a default", "args": ["2026-01-01", "2026-07-01", "act-365"], "expectError": "unknown day count convention \"act-365\"" }, { "name": "an impossible date is an error", "args": ["2026-02-30", "2026-07-01", "act-360"], "expectError": "is not a real calendar date" } ]