aboutsummaryrefslogtreecommitdiff
path: root/tests/test-dirvish-config-public-wrappers.el
Commit message (Collapse)AuthorAgeFilesLines
* test: make subr mocks variadic for native-comp, add arity meta-testCraig Jennings2026-06-211-2/+2
| | | | | | | | 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.
* fix(dirvish): mark-all-visible no longer skips every other fileCraig Jennings2026-06-151-16/+3
| | | | dired-mark advances point itself, so the loop's extra forward-line skipped every other file (and could mark a directory). Use dired-get-filename + file-directory-p with an if/else: a marked file line advances once via dired-mark, non-file/directory lines advance manually. Replaces the regex line predicate (retired with its mock test) with a real-Dired marked-count test.
* test(dirvish-config): cover five interactive wrappersCraig Jennings2026-05-141-0/+209
Sibling tests covered the pure helpers; the interactive wrappers were the gap. 13 new tests cover: - `cj/dirvish-open-html-in-eww`: HTML file -> `eww-open-file`, non-HTML -> message. - `cj/dirvish-duplicate-file`: copies file with `-copy` suffix, errors on no-file / directory / declined-overwrite. - `cj/dired-mark-all-visible-files`: marks file lines, skips directory lines (via `cj/--dired-line-is-directory-p`). - `cj/dired-copy-path-as-kill`: errors outside dired-mode, kills resolved path, formats as org-link when asked. - `cj/dirvish-open-file-manager-here`: uses `cj/external-open-command` when available, falls back to `xdg-open` shell command otherwise, messages when current dir can't be resolved. The decline-overwrite test uses real temp files instead of `cl-letf`-overriding `file-directory-p` + `file-exists-p` -- native-comp's trampoline cache breaks when several built-ins get redefined in the same test.