diff options
author | Damien Cassou <damien@cassou.me> | 2017-04-12 07:35:56 +0200 |
---|---|---|
committer | Nicolas Petton <nicolas@petton.fr> | 2017-04-13 11:44:17 +0200 |
commit | 4e77ff0d45b88cade7836c01344cd8d892adfde8 (patch) | |
tree | 52537b9cc31b0bde9384aeec939fb24b546790e8 /test/lisp/imenu-tests.el | |
parent | 88e012511ac6bfd7eb31b14d792ab0005e3693a8 (diff) | |
download | emacs-4e77ff0d45b88cade7836c01344cd8d892adfde8.tar.gz emacs-4e77ff0d45b88cade7836c01344cd8d892adfde8.tar.bz2 emacs-4e77ff0d45b88cade7836c01344cd8d892adfde8.zip |
Fix imenu--sort-by-position for non-pairs parameters (bug#26457)
* lisp/imenu.el (imenu--sort-by-position): Fix to accept lists beyond
pairs.
* test/lisp/imenu-tests.el: Add 2 tests for `imenu--sort-by-position`.
Diffstat (limited to 'test/lisp/imenu-tests.el')
-rw-r--r-- | test/lisp/imenu-tests.el | 10 |
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 |