summaryrefslogtreecommitdiff
path: root/test/lisp/imenu-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/imenu-tests.el')
-rw-r--r--test/lisp/imenu-tests.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/imenu-tests.el b/test/lisp/imenu-tests.el
index 480368fcbb6..93090947139 100644
--- a/test/lisp/imenu-tests.el
+++ b/test/lisp/imenu-tests.el
@@ -83,6 +83,16 @@ function ABC_D()
}
" '("a" "b" "c" "ABC_D"))
+(ert-deftest imenu--sort-by-position-pairs ()
+ (should (imenu--sort-by-position '("a" . 2) '("a" . 3)))
+ (should-not (imenu--sort-by-position '("a" . 3) '("a" . 2))))
+
+;; Regression test for bug#26457: 25.2; Cannot pass a function to
+;; imenu-generic-expression
+(ert-deftest imenu--sort-by-position-list ()
+ (should (imenu--sort-by-position '("a" 2 nil) '("a" 3 nil)))
+ (should-not (imenu--sort-by-position '("a" 3 nil) '("a" 2 nil))))
+
(provide 'imenu-tests)
;;; imenu-tests.el ends here