bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26457: 25.2; Cannot pass a function to imenu-generic-expression


From: Nicolas Petton
Subject: bug#26457: 25.2; Cannot pass a function to imenu-generic-expression
Date: Wed, 12 Apr 2017 10:24:34 +0200

Damien Cassou <address@hidden> writes:

>  (defun imenu--sort-by-position (item1 item2)
> -  (< (cdr item1) (cdr item2)))
> +  "Comparison function to sort items depending on their position.
> +Return t if and only if ITEM1's position is lower than ITEM2's
          ^^        
          We usually say "non-nil".

> +(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))))

Thanks for the regression test!

Cheers,
Nico





reply via email to

[Prev in Thread] Current Thread [Next in Thread]