Deterministic tests and no preference litter !459

merged merged by cmc on 2026-11-22 18:20 UTC · krz/orgstar:issue-204-test-hygiene into main

Discussion

cmc
  • Random tests use a fixed seed (20261122) and print it on failure; ORGSTAR_SEED=<n> swift test runs another. Covers CalcTests, CalcNumericTests, ListItemScanTests and LineIndexTests.
  • abs(vmin([(3 - uinf) ^ (-1)], [0. < (-1 > 2.5)])): in a vector without commas Calc reads < after a space as the start of a date ([0 < (1 > 2)] is [0, <2026-01-02 Fri>]), so the vector holds a date and vmin gives nan. Orgstar now refuses that syntax.
  • 2*(((-1)/0+1.)*(-24)): Calc stops at max-lisp-eval-depth; orgstar overflowed the stack in Symbolic.mul. mul nesting past 64 is refused. Found by the default seed of symbolicMatchesCalc.
  • AgendaModelTests.checksFilesOffTheMainActor checks through AgendaModel.willStat that each file stat runs off the main thread, instead of timing the main actor. Fails on the code before 76e3cf9 (40 of 40 stats on the main thread).
  • TestDefaults (OrgAppTests) keeps each suite as a plist in the temporary folder and removes it when released; every test suite creation uses it. A full run adds no files to ~/Library/Preferences.

Tested: three full swift test runs pass; symbolicFunctionsMatchCalc over 300 seeds and all seeded Calc tests over 50 seeds pass; both Xcode builds succeed.

Closes #204 Closes #215