aboutsummaryrefslogtreecommitdiff
path: root/tests/test-keybindings--jump-open-var.el
Commit message (Collapse)AuthorAgeFilesLines
* test: make subr mocks variadic for native-comp, add arity meta-testCraig Jennings2026-06-211-1/+1
| | | | | | | | Re-enabling native-comp surfaced a suite-wide fragility. When a test redefines a C primitive (or a native-compiled function), native-comp routes native callers through a trampoline that calls the mock with the primitive's maximum arity. A fixed-arity mock narrower than the primitive then throws wrong-number-of-arguments, intermittently, as the eln-cache fills. I swept every arity-narrow subr mock to append &rest _ (188 sites, preserving any named args the body uses), and added tests/test-meta-subr-mock-arity.el, which fails make test on any subr mock too narrow for the primitive's arity. The rule isn't "never mock a subr". The suite mocks message and completing-read freely. It's "a subr mock must accept the primitive's arity." Background, the three failure modes, and the research are in docs/native-comp-subr-mocking.org.
* test(keybindings): cover cj/jump-open-var and the jump-commands wiringCraig Jennings2026-04-301-0/+92
Two test files for keybindings.el. cj/jump-open-var gets full N/B/E coverage (6 tests): existing-file happy path, plus error paths for unbound symbol, nil value, non-string value, empty string, and missing file. The smoke file for the auto-generated cj/jump-to-NAME commands asserts that each spec entry has an fbound command, that the command is bound in cj/jump-map at the spec's key, that calling each command invokes cj/jump-open-var with the spec's var, and that cj/jump-map is mounted under cj/custom-keymap at "j". The test fixture variable is declared at top level. If it were let-bound inside a test under lexical-binding, the let would create a lexical binding that shadows the dynamic one. The production code's symbol-value would then miss what setq writes. find-file is mocked at the boundary so the existing-file test doesn't actually open a buffer. 10 tests pass. No production change in keybindings.el.