aboutsummaryrefslogtreecommitdiff
path: root/tests/test-system-utils-identify-external-open-command.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-03 07:53:51 -0500
committerCraig Jennings <c@cjennings.net>2026-05-03 07:53:51 -0500
commit7ee85b7b8c39cd1d1724f7d36e06ac4eff57862a (patch)
tree25fe9c0e142fd5b42973090eeaf7b7e4ac293989 /tests/test-system-utils-identify-external-open-command.el
parent61ac489b00b26f8082806c28bfc7c6f1fd5573d8 (diff)
downloaddotemacs-7ee85b7b8c39cd1d1724f7d36e06ac4eff57862a.tar.gz
dotemacs-7ee85b7b8c39cd1d1724f7d36e06ac4eff57862a.zip
test(calendar-sync): fix weekday-string lookup to match production
The boundary test for `calendar-sync--expand-weekly` with a 5-element UNTIL built its byday string from `'("SU" "MO" "TU" "WE" "TH" "FR" "SA")`, a 0-indexed Sunday-first array. The production code uses Monday=1, Sunday=7 throughout: `calendar-sync--date-weekday` returns it that way and `calendar-sync--weekday-to-number` expects it. When start-date landed on a Sunday (start-weekday=7), `(nth 7 array)` overran the 7-element list and returned nil. Then byday=(nil), and inside expand-weekly `(mod (- nil current-weekday) 7)` raised "wrong-type-argument number-or-marker-p nil". The mismatch made the test fail every Saturday (when "tomorrow" is Sunday) and pass the other six days. The flake had been blamed on stale `.elc` in earlier triage, but `make clean && make test` reproduced the failure on Saturdays. I switched the lookup to `(nth (1- start-weekday) '("MO" "TU" "WE" "TH" "FR" "SA" "SU"))`, the same convention as every other weekday-mapping in the codebase. I verified across all 7 weekdays via a faked `current-time`: each produces exactly 1 occurrence as expected. Production code is internally consistent. No production change needed.
Diffstat (limited to 'tests/test-system-utils-identify-external-open-command.el')
0 files changed, 0 insertions, 0 deletions