aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ai-vterm--pick-buffer-candidates.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 07:18:20 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 07:18:20 -0500
commit4000330e5e6536f64f404c1cabc8dc86d9556bb5 (patch)
treebb0ad65fb1cb9b1dba629998fe2983a9a3020fa7 /tests/test-ai-vterm--pick-buffer-candidates.el
parent56680633ea0e1b549fd7087c1f9d6d1abf9f0690 (diff)
downloaddotemacs-4000330e5e6536f64f404c1cabc8dc86d9556bb5.tar.gz
dotemacs-4000330e5e6536f64f404c1cabc8dc86d9556bb5.zip
refactor(ai-vterm): rename Claude-specific names to a generic "agent"
I may add other terminal agents to this launcher (aider, an open-source LLM TUI), so the buffer prefix, the user knob, and the internal helpers shouldn't say "Claude". The module name (ai-vterm) and the `cj/ai-vterm-*` customs were already generic. This finishes the job: - buffer prefix `claude [<basename>]` -> `agent [<basename>]` (the `defconst` and the matching display-buffer-alist regex move together) - `cj/ai-vterm-claude-command` -> `cj/ai-vterm-agent-command` (the default still runs the `claude` CLI, with a docstring note on swapping it) - `cj/--ai-vterm-claude-buffers` / `-displayed-claude-window` / `-reuse-existing-claude` -> `-agent-*`, and their test files renamed to match - prose in the module commentary and docstrings, plus the matching test docstrings and buffer-name literals `vterm-config.el` hardcodes the same buffer prefix in `cj/--vterm-toggle-buffer-p` (F12 excludes agent buffers from its candidate set), so that literal moved too. Collapsing it into the shared `cj/--ai-vterm-name-prefix` is a cleanup for another day. After a reload, a project's buffer opens as `agent [foo]` instead of `claude [foo]`. Old buffers keep their names until killed. I also corrected two stale `eshell-vterm-config.el` references in ai-vterm.el docstrings (that module was split into `vterm-config.el`). Two things keep saying "Claude": the `cj/ai-vterm-agent-command` default value (the actual CLI), and the "Claude Code" example in `vterm-config.el`'s cursor-restore docstring (a concrete TUI example, not branding). 90 tests pass. `make validate-modules` clean.
Diffstat (limited to 'tests/test-ai-vterm--pick-buffer-candidates.el')
-rw-r--r--tests/test-ai-vterm--pick-buffer-candidates.el40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/test-ai-vterm--pick-buffer-candidates.el b/tests/test-ai-vterm--pick-buffer-candidates.el
index ddfd7529..c32039de 100644
--- a/tests/test-ai-vterm--pick-buffer-candidates.el
+++ b/tests/test-ai-vterm--pick-buffer-candidates.el
@@ -22,57 +22,57 @@
(ert-deftest test-ai-vterm--pick-buffer-candidates-empty-buffers ()
"Boundary: empty buffer list -> empty alist regardless of shown."
- (cj/test--kill-claude-buffers)
+ (cj/test--kill-agent-buffers)
(should (null (cj/--ai-vterm-pick-buffer-candidates nil nil)))
(should (null (cj/--ai-vterm-pick-buffer-candidates nil 'sentinel))))
(ert-deftest test-ai-vterm--pick-buffer-candidates-shown-nil ()
"Normal: shown is nil -> straight alist in input order, no marker."
- (cj/test--kill-claude-buffers)
- (let ((b1 (get-buffer-create "claude [a]"))
- (b2 (get-buffer-create "claude [b]")))
+ (cj/test--kill-agent-buffers)
+ (let ((b1 (get-buffer-create "agent [a]"))
+ (b2 (get-buffer-create "agent [b]")))
(unwind-protect
(let ((result (cj/--ai-vterm-pick-buffer-candidates (list b1 b2) nil)))
- (should (equal result `(("claude [a]" . ,b1)
- ("claude [b]" . ,b2)))))
+ (should (equal result `(("agent [a]" . ,b1)
+ ("agent [b]" . ,b2)))))
(kill-buffer b1)
(kill-buffer b2))))
(ert-deftest test-ai-vterm--pick-buffer-candidates-shown-promotes-non-shown ()
"Normal: shown buffer sorts last with [shown] suffix; others first."
- (cj/test--kill-claude-buffers)
- (let ((b1 (get-buffer-create "claude [a]"))
- (b2 (get-buffer-create "claude [b]"))
- (b3 (get-buffer-create "claude [c]")))
+ (cj/test--kill-agent-buffers)
+ (let ((b1 (get-buffer-create "agent [a]"))
+ (b2 (get-buffer-create "agent [b]"))
+ (b3 (get-buffer-create "agent [c]")))
(unwind-protect
(let ((result (cj/--ai-vterm-pick-buffer-candidates
(list b1 b2 b3) b1)))
(should (equal result
- `(("claude [b]" . ,b2)
- ("claude [c]" . ,b3)
- ("claude [a] [shown]" . ,b1)))))
+ `(("agent [b]" . ,b2)
+ ("agent [c]" . ,b3)
+ ("agent [a] [shown]" . ,b1)))))
(kill-buffer b1)
(kill-buffer b2)
(kill-buffer b3))))
(ert-deftest test-ai-vterm--pick-buffer-candidates-shown-only-buffer ()
"Boundary: shown is the only entry -> single cell with [shown] marker."
- (cj/test--kill-claude-buffers)
- (let ((b1 (get-buffer-create "claude [a]")))
+ (cj/test--kill-agent-buffers)
+ (let ((b1 (get-buffer-create "agent [a]")))
(unwind-protect
(let ((result (cj/--ai-vterm-pick-buffer-candidates (list b1) b1)))
- (should (equal result `(("claude [a] [shown]" . ,b1)))))
+ (should (equal result `(("agent [a] [shown]" . ,b1)))))
(kill-buffer b1))))
(ert-deftest test-ai-vterm--pick-buffer-candidates-shown-not-in-buffers ()
"Boundary: stale shown buffer not in list -> all cells are non-shown."
- (cj/test--kill-claude-buffers)
- (let ((b1 (get-buffer-create "claude [a]"))
- (b-stale (get-buffer-create "claude [stale]")))
+ (cj/test--kill-agent-buffers)
+ (let ((b1 (get-buffer-create "agent [a]"))
+ (b-stale (get-buffer-create "agent [stale]")))
(unwind-protect
(let ((result (cj/--ai-vterm-pick-buffer-candidates
(list b1) b-stale)))
- (should (equal result `(("claude [a]" . ,b1)))))
+ (should (equal result `(("agent [a]" . ,b1)))))
(kill-buffer b1)
(kill-buffer b-stale))))