1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 16:21:07 -08:00

Make seq-into return the sequence when no conversion needed

* lisp/emacs-lisp/seq.el (seq-into): Do not convert the sequence when
  no conversion is needed.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-into-and-identity): Add
  a regression test checking for identity.
This commit is contained in:
Nicolas Petton 2016-12-16 11:18:04 +01:00
parent cdf5340f51
commit fb2fdb1435
2 changed files with 30 additions and 6 deletions

View file

@ -391,5 +391,13 @@ Evaluate BODY for each created sequence.
(should (equal (seq-mapn #'+ '(3 4 5 7) l1)
'(4 5 6 8)))))
(ert-deftest test-seq-into-and-identity ()
(let ((lst '(1 2 3))
(vec [1 2 3])
(str "foo bar"))
(should (eq (seq-into lst 'list) lst))
(should (eq (seq-into vec 'vector) vec))
(should (eq (seq-into str 'string) str))))
(provide 'seq-tests)
;;; seq-tests.el ends here