Repository navigation
3.0.0-alpha.3 — a grid that moved with the clock, and tests that could not fail
Pre-releaseNo API changes. alpha.3 is alpha.2 plus one behavioural fix and a test suite that now reports what it actually did.
from: ranges exclude pre-releases, so from: "2.7.0" still resolves to 2.18.0 and nothing changes for existing consumers. To try the alpha, name it exactly:
.package(url: "https://github.com/jpurnell/BusinessMath.git", exact: "3.0.0-alpha.3")Fixed
The coupon grid no longer moves with the machine's time zone. CouponPeriod and ACCRINT's quasi-coupon walk stepped through the schedule with Calendar.current, so a maturity given as a UTC midnight decomposed to the previous day anywhere west of Greenwich and the whole grid shifted with it — asymmetrically, since a six-month step crossing a daylight-saving boundary moved where one that did not stayed put. PRICE was out by about 0.017 per 100 of face on Microsoft's own worked example.
It was invisible from inside this package: ExcelBondFunctionTests built its dates with Calendar.current too, so the tests and the code agreed with each other in every zone. It surfaced only when SwiftExcelFunctions handed in the UTC midnights an Excel date serial decodes to.
Testing
41 tests reported passed while asserting nothing.
-
30 GPU tests opened with a guard whose
nilmeant "no Metal device here" — which reports passed. They now carry a new.requiresMetalGPUtrait and report skipped, and the guards inside becametry #require. This is howMonteCarloRNGTestswent a year without executing a single kernel.Verified by negative control, not by the green run: with the availability probe forced to
false, all 28 tests reportskippedwith a reason in 0.001s against 0.499s when they execute. A probe stuck atfalsewould also have printed green — and would have been worse than the guards it replaced. -
11 tests returned early from an unmet precondition. Six asserted nothing beforehand: an empty fixture passed two determinism tests without loading a case, and a zero mean-square deleted the one check pinning
F_betweento the correct denominator.
8 of 18 disabled tests are running again. Two PeriodTests were disabled because "precondition() failures cannot be caught in Swift Testing" — true when written, and untrue since the framework gained exit tests. Both are now #expect(processExitsWith: .failure) and both pass. Six benchmarks moved from .disabled() to the .benchmarkOnly trait this repo already had; five of them carried a bare .disabled() with no reason at all, and all of them pass under RUN_BENCHMARKS=1.
Ten disabled tests remain; three are blocked on product defects and are filed, not fixed.
Verification
Full suite 7,631 tests in 680 suites, exit 0. Quality gate 45/45, 0/0, 1,241 files examined.