diff options
author | Earl Hyatt <okamsn@protonmail.com> | 2021-08-14 14:17:55 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-08-14 14:17:55 +0200 |
commit | a8a3fd8f8e27089ac46bf98e534529ff03f679a5 (patch) | |
tree | fc13287c6528608eaf6ff95c3bc09285650e8cb1 /test/lisp/emacs-lisp/seq-tests.el | |
parent | c58f8dda2b2282302cf47ef3e7df6523bde606f5 (diff) | |
download | emacs-a8a3fd8f8e27089ac46bf98e534529ff03f679a5.tar.gz emacs-a8a3fd8f8e27089ac46bf98e534529ff03f679a5.tar.bz2 emacs-a8a3fd8f8e27089ac46bf98e534529ff03f679a5.zip |
Add macro `seq-setq`.
* doc/lispref/sequences.texi (seq-setq): Document this macro.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-setq):
Test this macro (bug#50053).
Diffstat (limited to 'test/lisp/emacs-lisp/seq-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/seq-tests.el | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index 44e855e2cfa..5217921d3d7 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -407,6 +407,30 @@ Evaluate BODY for each created sequence. (should (null b)) (should (null c)))) +(ert-deftest test-seq-setq () + (with-test-sequences (seq '(1 2 3 4)) + (let (a b c d e) + (seq-setq (a b c d e) seq) + (should (= a 1)) + (should (= b 2)) + (should (= c 3)) + (should (= d 4)) + (should (null e))) + (let (a b others) + (seq-setq (a b &rest others) seq) + (should (= a 1)) + (should (= b 2)) + (should (same-contents-p others (seq-drop seq 2))))) + (let ((a) + (seq '(1 (2 (3 (4)))))) + (seq-setq (_ (_ (_ (a)))) seq) + (should (= a 4))) + (let (seq a b c) + (seq-setq (a b c) seq) + (should (null a)) + (should (null b)) + (should (null c)))) + (ert-deftest test-seq-min-max () (with-test-sequences (seq '(4 5 3 2 0 4)) (should (= (seq-min seq) 0)) |