diff options
| author | Damien Cassou | 2017-04-12 07:35:56 +0200 |
|---|---|---|
| committer | Nicolas Petton | 2017-04-13 11:44:17 +0200 |
| commit | 4e77ff0d45b88cade7836c01344cd8d892adfde8 (patch) | |
| tree | 52537b9cc31b0bde9384aeec939fb24b546790e8 /test | |
| parent | 88e012511ac6bfd7eb31b14d792ab0005e3693a8 (diff) | |
| download | emacs-4e77ff0d45b88cade7836c01344cd8d892adfde8.tar.gz 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')
| -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() | |||
| 83 | } | 83 | } |
| 84 | " '("a" "b" "c" "ABC_D")) | 84 | " '("a" "b" "c" "ABC_D")) |
| 85 | 85 | ||
| 86 | (ert-deftest imenu--sort-by-position-pairs () | ||
| 87 | (should (imenu--sort-by-position '("a" . 2) '("a" . 3))) | ||
| 88 | (should-not (imenu--sort-by-position '("a" . 3) '("a" . 2)))) | ||
| 89 | |||
| 90 | ;; Regression test for bug#26457: 25.2; Cannot pass a function to | ||
| 91 | ;; imenu-generic-expression | ||
| 92 | (ert-deftest imenu--sort-by-position-list () | ||
| 93 | (should (imenu--sort-by-position '("a" 2 nil) '("a" 3 nil))) | ||
| 94 | (should-not (imenu--sort-by-position '("a" 3 nil) '("a" 2 nil)))) | ||
| 95 | |||
| 86 | (provide 'imenu-tests) | 96 | (provide 'imenu-tests) |
| 87 | 97 | ||
| 88 | ;;; imenu-tests.el ends here | 98 | ;;; imenu-tests.el ends here |