Skip to content

Cover the rest of the commands worth driving - #2174

Merged
bbatsov merged 1 commit into
masterfrom
test/cover-remaining-commands
Aug 25, 2026
Merged

Cover the rest of the commands worth driving#2174
bbatsov merged 1 commit into
masterfrom
test/cover-remaining-commands

Conversation

@bbatsov

@bbatsov bbatsov commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Sixteen more functions the suite never entered, all reached through a command: find-dir, find-file-dwim, recentf, edit-dir-locals, run-command-in-root, version, previous-project-buffer, the impl/test toggle, the three remaining lifecycle commands and repeat-last-command.

Two corrections came out of writing them. projectile-recentf gates on (boundp 'recentf-list), and a let cannot make an unbound non-special symbol bound - the spec has to load recentf. And repeat-last-command reads a ring via projectile--get-command-history, not any "last command" accessor, so my first attempt was asserting against a function that doesn't exist.

90.0% -> 91.9%, 84 never entered -> 68. The remainder is mostly code that spawns a terminal or a process, the Mercurial paths, and the dashboard/doctor renderers.

Sixteen more functions the suite never entered, all reached through a
command: find-dir, find-file-dwim, recentf, edit-dir-locals,
run-command-in-root, version, previous-project-buffer, the impl/test
toggle, the three remaining lifecycle commands and repeat-last-command.

Writing them cost two corrections worth keeping.  `recentf' gates on
`(boundp 'recentf-list)', and a `let' cannot make an unbound non-special
symbol bound, so the spec has to load recentf rather than bind the
variable.  And `repeat-last-command' reads a ring through
`projectile--get-command-history' rather than any "last command"
accessor, so the first version of that spec was testing a function that
does not exist.

Function coverage 90.0% -> 91.9%, 84 functions never entered -> 68.  What
is left is mostly code that spawns a terminal or a process, the Mercurial
paths, and the dashboard and doctor renderers.
@bbatsov
bbatsov merged commit 48e3f29 into master Aug 25, 2026
10 checks passed
@bbatsov
bbatsov deleted the test/cover-remaining-commands branch August 25, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant