]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/seq/tests/seq-tests.el
Update seq.el to version 1.3
[gnu-emacs-elpa] / packages / seq / tests / seq-tests.el
index badb3267f436d975c53d0da10a4a2e54aca7007d..d3536b6f9a6930127c940429abdc1f33ee56e898 100644 (file)
@@ -228,5 +228,27 @@ Evaluate BODY for each created sequence.
     (should (equal (type-of (seq-reverse seq))
                    (type-of seq)))))
 
+(ert-deftest test-seq-into ()
+  (let* ((vector [1 2 3])
+         (list (seq-into vector 'list)))
+    (should (same-contents-p vector list))
+    (should (listp list)))
+  (let* ((list '(hello world))
+         (vector (seq-into list 'vector)))
+    (should (same-contents-p vector list))
+    (should (vectorp vector)))
+  (let* ((string "hello")
+         (list (seq-into string 'list)))
+    (should (same-contents-p string list))
+    (should (stringp string)))
+  (let* ((string "hello")
+         (vector (seq-into string 'vector)))
+    (should (same-contents-p string vector))
+    (should (stringp string)))
+  (let* ((list nil)
+         (vector (seq-into list 'vector)))
+    (should (same-contents-p list vector))
+    (should (vectorp vector))))
+
 (provide 'seq-tests)
 ;;; seq-tests.el ends here