diff options
author | Nicolas Petton <nicolas@petton.fr> | 2016-03-29 09:19:32 +0200 |
---|---|---|
committer | Nicolas Petton <nicolas@petton.fr> | 2016-03-29 09:19:32 +0200 |
commit | 2946344a231a915d5143017b70e91a9a7a9b11aa (patch) | |
tree | 21d46bb829f4f9b9a130b6dbd7e12b268f7e80f8 /test/lisp/emacs-lisp/seq-tests.el | |
parent | a30e7e12ed8465e2565dd318d921bc87f52ce18e (diff) | |
download | emacs-2946344a231a915d5143017b70e91a9a7a9b11aa.tar.gz emacs-2946344a231a915d5143017b70e91a9a7a9b11aa.tar.bz2 emacs-2946344a231a915d5143017b70e91a9a7a9b11aa.zip |
New function seq-sort-by in seq.el
* lisp/emacs-lisp/seq.el (seq-sort-by): New function.
* test/lisp/emacs-lisp/seq-tests.el: New test for seq-sort-by.
* doc/lispref/sequences.texi: Add documentation for seq-sort-by.
Diffstat (limited to 'test/lisp/emacs-lisp/seq-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/seq-tests.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index c9219b51d00..50543de8ada 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -347,5 +347,10 @@ Evaluate BODY for each created sequence. (should (= (seq-position seq 'a #'eq) 0)) (should (null (seq-position seq (make-symbol "a") #'eq))))) +(ert-deftest test-seq-sort-by () + (let ((seq ["x" "xx" "xxx"])) + (should (equal (seq-sort-by #'seq-length #'> seq) + ["xxx" "xx" "x"])))) + (provide 'seq-tests) ;;; seq-tests.el ends here |