* test/lisp/emacs-lisp/tabulated-list-tests.el: Add missing test.
authorJuri Linkov <juri@linkov.net>
Sun, 1 Sep 2024 17:17:03 +0000 (20:17 +0300)
committerJuri Linkov <juri@linkov.net>
Sun, 1 Sep 2024 17:17:03 +0000 (20:17 +0300)
(tabulated-list-groups-with-path): Add test for tabulated-list-groups.

test/lisp/emacs-lisp/tabulated-list-tests.el

index e53268b3f14dc3bd55a4f0fc248ba707c74ad8bc..7edcaaf9441c0ba22f24a9f85038fb8f272be36a 100644 (file)
        4clojure   4clojure   1507      obsolete    Open and evaluate 4clojure.com questions
 ")))))
 
+(ert-deftest tabulated-list-groups-with-path ()
+  (with-temp-buffer
+    (tabulated-list-mode)
+    (setq tabulated-list-groups
+          (tabulated-list-groups
+           tabulated-list--test-entries
+           `( :path-function (lambda (entry)
+                               (list (list (aref (cadr entry) 3))))
+              :sort-function (lambda (groups _level)
+                               (sort groups :in-place t :key #'car)))))
+    (setq tabulated-list-format tabulated-list--test-format)
+    (setq tabulated-list-padding 7)
+    (tabulated-list-init-header)
+    (tabulated-list-print)
+    ;; Basic printing.
+    (should (string-equal
+             (buffer-substring-no-properties (point-min) (point-max))
+             "\
+* available
+       abc-mode   abc-mode   944       available   Major mode for editing abc music files
+* installed
+       zzzz-game  zzzz-game  2113      installed   play zzzz in Emacs
+       mode       mode       1128      installed   A simple mode for editing Actionscript 3 files
+* obsolete
+       4clojure   4clojure   1507      obsolete    Open and evaluate 4clojure.com questions
+"))))
+
 ;;; tabulated-list-tests.el ends here