aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ai-config-current-model-selection.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-23 20:12:58 -0400
committerCraig Jennings <c@cjennings.net>2026-06-23 20:12:58 -0400
commite41c25068d0cec9434895a6d3e3a25d3a26f645f (patch)
tree5e30938a3fd6d80f501ffe3e6c1c187c5ddeb2c9 /tests/test-ai-config-current-model-selection.el
parenta936e081b7270fbd4f1e7e9cb67ca1d4c2291ce6 (diff)
downloaddotemacs-e41c25068d0cec9434895a6d3e3a25d3a26f645f.tar.gz
dotemacs-e41c25068d0cec9434895a6d3e3a25d3a26f645f.zip
chore(ai): archive gptel and remove it from the live config
I archived gptel to archive/gptel/ since I rarely use it. Moved there: the six gptel modules (ai-config, ai-conversations, ai-conversations-browser, ai-mcp, ai-quick-ask, ai-rewrite), the gptel-tools/ directory, custom/gptel-prompts.el, their test files and utilities, and the four gptel-only specs. Scrubbed from the live config: the ai-config require in init.el, which also drops the whole C-; a keymap; the gptel-mode emojify hook in font-config.el; the gptel-tools entries in the Makefile clean target and the coverage runner; and the gptel feature notes in README. Cancelled the open gptel tasks in todo.org (the AI Open Work issues, the feature-extension brainstorm, the velox gptel-magit bug). ai-term stays. It is the ghostel Claude launcher, independent of gptel. Verified: every module loads, a batch init launch reaches completion clean, and the full test suite shows only pre-existing coverage failures unrelated to this change.
Diffstat (limited to 'tests/test-ai-config-current-model-selection.el')
-rw-r--r--tests/test-ai-config-current-model-selection.el74
1 files changed, 0 insertions, 74 deletions
diff --git a/tests/test-ai-config-current-model-selection.el b/tests/test-ai-config-current-model-selection.el
deleted file mode 100644
index 14f9391c8..000000000
--- a/tests/test-ai-config-current-model-selection.el
+++ /dev/null
@@ -1,74 +0,0 @@
-;;; test-ai-config-current-model-selection.el --- Tests for cj/gptel--current-model-selection -*- lexical-binding: t; -*-
-
-;;; Commentary:
-;; Tests for cj/gptel--current-model-selection from ai-config.el.
-;;
-;; Pure function that formats the active backend and model into a display
-;; string like "Anthropic - Claude: claude-opus-4-6". Used as the default
-;; selection in the model-switching completing-read prompt.
-
-;;; Code:
-
-(require 'ert)
-
-(add-to-list 'load-path (expand-file-name "tests" user-emacs-directory))
-(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
-(require 'testutil-ai-config)
-(require 'ai-config)
-
-;;; Normal Cases
-
-(ert-deftest test-ai-config-current-model-selection-normal-matching-backend ()
- "When current backend is in the backends alist, use its display name."
- (let* ((backend-obj 'my-backend)
- (backends `(("Anthropic - Claude" . ,backend-obj))))
- (should (equal (cj/gptel--current-model-selection backends backend-obj "opus")
- "Anthropic - Claude: opus"))))
-
-(ert-deftest test-ai-config-current-model-selection-normal-symbol-model ()
- "Symbol model should be converted to string in the output."
- (let* ((backend-obj 'my-backend)
- (backends `(("Claude" . ,backend-obj))))
- (should (equal (cj/gptel--current-model-selection backends backend-obj 'opus)
- "Claude: opus"))))
-
-(ert-deftest test-ai-config-current-model-selection-normal-multiple-backends ()
- "Should find the correct backend name among multiple backends."
- (let* ((backend-a 'backend-a)
- (backend-b 'backend-b)
- (backends `(("Claude" . ,backend-a) ("OpenAI" . ,backend-b))))
- (should (equal (cj/gptel--current-model-selection backends backend-b "gpt-4o")
- "OpenAI: gpt-4o"))))
-
-;;; Boundary Cases
-
-(ert-deftest test-ai-config-current-model-selection-boundary-nil-backend-shows-ai ()
- "Nil backend (not in alist) should fall back to \"AI\"."
- (should (equal (cj/gptel--current-model-selection '(("Claude" . x)) nil "opus")
- "AI: opus")))
-
-(ert-deftest test-ai-config-current-model-selection-boundary-unknown-backend-shows-ai ()
- "Backend not found in alist should fall back to \"AI\"."
- (should (equal (cj/gptel--current-model-selection
- '(("Claude" . backend-a)) 'unknown-backend "opus")
- "AI: opus")))
-
-(ert-deftest test-ai-config-current-model-selection-boundary-nil-model ()
- "Nil model should produce \"nil\" in the model position (symbolp nil)."
- (let* ((backend 'my-backend)
- (backends `(("Claude" . ,backend))))
- (should (equal (cj/gptel--current-model-selection backends backend nil)
- "Claude: nil"))))
-
-(ert-deftest test-ai-config-current-model-selection-boundary-empty-backends ()
- "Empty backends alist should fall back to \"AI\" for backend name."
- (should (equal (cj/gptel--current-model-selection nil 'anything "model")
- "AI: model")))
-
-(ert-deftest test-ai-config-current-model-selection-boundary-both-nil ()
- "Nil backend and nil model should produce \"AI: nil\"."
- (should (equal (cj/gptel--current-model-selection nil nil nil)
- "AI: nil")))
-
-(provide 'test-ai-config-current-model-selection)
-;;; test-ai-config-current-model-selection.el ends here