Add new function `seq-remove-at-position'
* doc/lispref/sequences.texi (Sequence Functions): Document it. * lisp/emacs-lisp/seq.el (seq-remove-at-position): New function. * lisp/emacs-lisp/shortdoc.el (sequence): Mention it. * test/lisp/emacs-lisp/seq-tests.el (test-seq-remove-at-position): Test it.
This commit is contained in:
parent
77b761dafa
commit
2db8b0e12f
5 changed files with 48 additions and 0 deletions
|
@ -137,6 +137,14 @@ Evaluate BODY for each created sequence.
|
|||
(with-test-sequences (seq '())
|
||||
(should (equal (seq-remove #'test-sequences-evenp seq) '()))))
|
||||
|
||||
(ert-deftest test-seq-remove-at-position ()
|
||||
(with-test-sequences (seq '(1 2 3 4))
|
||||
(should (same-contents-p (seq-remove-at-position seq 2) '(1 2 4)))
|
||||
(should (same-contents-p (seq-remove-at-position seq 0) '(2 3 4)))
|
||||
(should (same-contents-p (seq-remove-at-position seq 3) '(1 2 3)))
|
||||
(should (eq (type-of (seq-remove-at-position seq 2))
|
||||
(type-of seq)))))
|
||||
|
||||
(ert-deftest test-seq-count ()
|
||||
(with-test-sequences (seq '(6 7 8 9 10))
|
||||
(should (equal (seq-count #'test-sequences-evenp seq) 3))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue