diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-24 05:50:46 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-24 05:51:12 -0400 |
| commit | 99cb7324bbd29342f57fa07dec74c366b9195382 (patch) | |
| tree | 697a72c4a80c2f6e94adecc039688fa14a21f79d /tests | |
| parent | 5e72000497732e7d20c179d2562e4bfacc1e3fbe (diff) | |
| download | dotemacs-99cb7324bbd29342f57fa07dec74c366b9195382.tar.gz dotemacs-99cb7324bbd29342f57fa07dec74c366b9195382.zip | |
feat(nerd-icons): drop the runtime tint so the theme drives icon color (phase 3)
Remove cj/nerd-icons-tint-color, cj/--nerd-icons-color-faces, cj/nerd-icons-apply-tint and its two call sites, so the 34 nerd-icons color faces are no longer force-set to one darkgoldenrod foreground at load time. The WIP theme already owns those faces (theme-studio auto-discovered them), so with the tint gone their per-filetype colors come from the theme and are editable in theme-studio's new nerd-icons pane. The dir-icon advice (cj/--nerd-icons-color-dir) stays — it points at a theme-owned face now. Delete the apply-tint test, which covered removed code.
Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-nerd-icons-config--apply-tint.el | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/tests/test-nerd-icons-config--apply-tint.el b/tests/test-nerd-icons-config--apply-tint.el deleted file mode 100644 index ef723352c..000000000 --- a/tests/test-nerd-icons-config--apply-tint.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; test-nerd-icons-config--apply-tint.el --- Tests for cj/nerd-icons-apply-tint -*- lexical-binding: t; -*- - -;;; Commentary: -;; Tests for the bulk-tint helper. Mocks `set-face-foreground' and `facep' -;; at the framework boundary so the tests don't depend on nerd-icons being -;; loaded — only on the symbol list and the dispatch logic. - -;;; Code: - -(require 'ert) -(require 'cl-lib) - -(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) -(require 'nerd-icons-config) - -(defmacro test-nerd-icons-config--capture-set-face-foreground (calls-var &rest body) - "Run BODY with `set-face-foreground' and `facep' stubbed. -Each (face color) pair gets pushed onto CALLS-VAR. `facep' returns t -for every symbol so all faces in the list count as defined." - (declare (indent 1) (debug t)) - `(cl-letf (((symbol-function 'set-face-foreground) - (lambda (face color &rest _) (push (cons face color) ,calls-var))) - ((symbol-function 'facep) - (lambda (_) t))) - ,@body)) - -(ert-deftest test-nerd-icons-config--apply-tint-covers-every-face () - "Normal: apply-tint calls set-face-foreground once per face in the list." - (let ((calls nil)) - (test-nerd-icons-config--capture-set-face-foreground calls - (cj/nerd-icons-apply-tint "test-color")) - (should (= (length calls) (length cj/--nerd-icons-color-faces))) - (dolist (face cj/--nerd-icons-color-faces) - (should (assq face calls))))) - -(ert-deftest test-nerd-icons-config--apply-tint-passes-color-arg () - "Normal: apply-tint forwards COLOR to every set-face-foreground call." - (let ((calls nil)) - (test-nerd-icons-config--capture-set-face-foreground calls - (cj/nerd-icons-apply-tint "rebeccapurple")) - (dolist (call calls) - (should (equal (cdr call) "rebeccapurple"))))) - -(ert-deftest test-nerd-icons-config--apply-tint-defaults-to-customvar () - "Normal: with no COLOR arg, uses `cj/nerd-icons-tint-color'." - (let ((calls nil)) - (test-nerd-icons-config--capture-set-face-foreground calls - (let ((cj/nerd-icons-tint-color "default-test-color")) - (cj/nerd-icons-apply-tint))) - (should (cl-every (lambda (call) (equal (cdr call) "default-test-color")) calls)))) - -(ert-deftest test-nerd-icons-config--apply-tint-skips-undefined-faces () - "Boundary: faces that fail `facep' are silently skipped, not errored." - (let ((calls nil)) - (cl-letf (((symbol-function 'set-face-foreground) - (lambda (face color &rest _) (push (cons face color) calls))) - ((symbol-function 'facep) - (lambda (_) nil))) - (cj/nerd-icons-apply-tint "any")) - (should (null calls)))) - -(provide 'test-nerd-icons-config--apply-tint) -;;; test-nerd-icons-config--apply-tint.el ends here |
