From de0c3f89889ed05e906dceaddf4068f2d417a0ac Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 24 Jun 2026 05:54:19 -0400 Subject: test(nerd-icons): dir-precedence probe + legend round-trip (phase 4) Lock the dir-precedence decision with an ERT probe: when a dir icon already carries nerd-icons-completion-dir-face, the advice's prepended nerd-icons-yellow is first in the face list and wins. Extend the #nerdiconstest browser gate with an export/import round-trip over an assigned nerd-icons color, asserting it re-imports to the same state and that the separate nerd-icons-completion dir-face stays out of the nerd-icons app. Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ --- tests/test-nerd-icons-config--color-dir.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/test-nerd-icons-config--color-dir.el b/tests/test-nerd-icons-config--color-dir.el index 808c0dc34..2ae64a810 100644 --- a/tests/test-nerd-icons-config--color-dir.el +++ b/tests/test-nerd-icons-config--color-dir.el @@ -53,5 +53,20 @@ renders would stack `nerd-icons-yellow' over and over on the cached string." (yellows (cl-count 'nerd-icons-yellow specs))) (should (= yellows 1))))) +(ert-deftest test-nerd-icons-config--color-dir-precedence-over-completion-face () + "Normal: when the dir icon already carries nerd-icons-completion-dir-face +\(what `nerd-icons-completion-get-icon' passes), the advice prepends +nerd-icons-yellow so it is first in the face list and wins the merge. Locks +the dir-precedence decision: the prepended advice face outranks the package's +:face, even though that face lives in a different package." + (let* ((icon (propertize "X" 'face 'nerd-icons-completion-dir-face)) + (result (cj/--nerd-icons-color-dir icon)) + (faces (ensure-list (get-text-property 0 'face result)))) + (should (memq 'nerd-icons-yellow faces)) + (should (memq 'nerd-icons-completion-dir-face faces)) + (should (= 0 (cl-position 'nerd-icons-yellow faces))) + (should (< (cl-position 'nerd-icons-yellow faces) + (cl-position 'nerd-icons-completion-dir-face faces))))) + (provide 'test-nerd-icons-config--color-dir) ;;; test-nerd-icons-config--color-dir.el ends here -- cgit v1.2.3