From f6bb2b95847e5b07bd709026716116b1e684a32b Mon Sep 17 00:00:00 2001 From: Senrokai Date: Tue, 29 Sep 2026 23:16:48 +0200 Subject: [PATCH] Pin the 1972 hand-over to the leap seconds from the later side too The test named for the hand-over caught the switch moved earlier and passed with it moved up to six months later: both samples round midnight then fall on the polynomial (a step of about 0), the last day of 1971 still reads 42.2485 s, and the 1972-06-30 = 42.184 check only sees a move past June. Such a switch leaves TT - UT up to 0.59 s high through the first half of 1972. The test now also requires 1 January 1972 itself to read the table's 42.184 s, the 10 s TAI - UTC began with plus 32.184. Control: the switch moved to JD_1972 + 120 now fails "hands over from the polynomial to the leap seconds at the start of 1972" only (1 failed, 843 passed of 844); before, the suite passed 841 of 841. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/app/shared/astro/constants.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/shared/astro/constants.spec.ts b/src/app/shared/astro/constants.spec.ts index b3c7f09..ed08bb6 100644 --- a/src/app/shared/astro/constants.spec.ts +++ b/src/app/shared/astro/constants.spec.ts @@ -29,9 +29,11 @@ describe('ttMinusUtSeconds', () => { it('hands over from the polynomial to the leap seconds at the start of 1972, 0.07 s apart', () => { // The switch is placed by the calendar, not by a 365.2425-day year, so it is sampled on either - // side of midnight; and the last day of 1971 must still be the polynomial's 42.25 s, not the - // table's 42.184, or the switch has moved. + // side of midnight; the last day of 1971 must still be the polynomial's 42.25 s, not the table's + // 42.184, or the switch has moved earlier; and midnight itself must already be the table's, or it + // has moved later, which the step alone cannot see once both samples fall on the polynomial. const start = jd(1972); + expect(ttMinusUtSeconds(start)).toBe(42.184); expect(Math.abs(ttMinusUtSeconds(start) - ttMinusUtSeconds(start - 1e-6))).toBeLessThan(0.1); expect(Math.abs(ttMinusUtSeconds(jd(1971, 12, 31)) - 42.2485)).toBeLessThan(0.01); });