aboutsummaryrefslogtreecommitdiff
path: root/tests/test-music-config--completion-table.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-music-config--completion-table.el')
-rw-r--r--tests/test-music-config--completion-table.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-music-config--completion-table.el b/tests/test-music-config--completion-table.el
index 5e33e655..6b3da442 100644
--- a/tests/test-music-config--completion-table.el
+++ b/tests/test-music-config--completion-table.el
@@ -19,6 +19,10 @@
(defvar-keymap cj/custom-keymap
:doc "Stub keymap for testing")
+;; Declare special here too (the module's bare defvar is file-local) so the
+;; registration test's `let' binds dynamically.
+(defvar marginalia-annotator-registry)
+
;; Load production code
(require 'music-config)
@@ -131,5 +135,15 @@
;; Should not crash, returns empty
(should (null result))))
+;;; Marginalia registration
+
+(ert-deftest test-music-config--completion-table-registers-with-marginalia ()
+ "Normal: building the table registers cj-music-file so marginalia
+right-aligns the size/date annotations."
+ (let ((marginalia-annotator-registry '()))
+ (cj/music--completion-table '("a.mp3"))
+ (should (equal (assq 'cj-music-file marginalia-annotator-registry)
+ '(cj-music-file builtin none)))))
+
(provide 'test-music-config--completion-table)
;;; test-music-config--completion-table.el ends here