aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNicolas Petton2015-03-09 12:46:29 +0100
committerNicolas Petton2015-03-09 12:50:24 +0100
commitb7ed48c3ce8e77acc08d4948684333bef3238d2d (patch)
treef391b49af05d99cdde85b933bdaeb1e6598d146c /test
parent8854b9cf5283cac3e4a5a3726325a82b88c1fcb5 (diff)
downloademacs-b7ed48c3ce8e77acc08d4948684333bef3238d2d.tar.gz
emacs-b7ed48c3ce8e77acc08d4948684333bef3238d2d.zip
Add seq-into as a public function
* lisp/emacs-lisp/seq.el: Make seq-into a public function (replacing seq--into) * test/automated/seq-tests.el: Add tests for seq-into * doc/lispref/sequences.texi: Add documentation for seq-into
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog4
-rw-r--r--test/automated/seq-tests.el22
2 files changed, 26 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 301cc4046e5..876b9462611 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
12015-03-09 Nicolas Petton <nicolas@petton.fr>
2
3 * automated/seq-tests.el (test-seq-into): Add a test for seq-into.
4
12015-03-08 Dmitry Gutov <dgutov@yandex.ru> 52015-03-08 Dmitry Gutov <dgutov@yandex.ru>
2 6
3 * indent/ruby.rb: Add an example for bug#20026. 7 * indent/ruby.rb: Add an example for bug#20026.
diff --git a/test/automated/seq-tests.el b/test/automated/seq-tests.el
index badb3267f43..d3536b6f9a6 100644
--- a/test/automated/seq-tests.el
+++ b/test/automated/seq-tests.el
@@ -228,5 +228,27 @@ Evaluate BODY for each created sequence.
228 (should (equal (type-of (seq-reverse seq)) 228 (should (equal (type-of (seq-reverse seq))
229 (type-of seq))))) 229 (type-of seq)))))
230 230
231(ert-deftest test-seq-into ()
232 (let* ((vector [1 2 3])
233 (list (seq-into vector 'list)))
234 (should (same-contents-p vector list))
235 (should (listp list)))
236 (let* ((list '(hello world))
237 (vector (seq-into list 'vector)))
238 (should (same-contents-p vector list))
239 (should (vectorp vector)))
240 (let* ((string "hello")
241 (list (seq-into string 'list)))
242 (should (same-contents-p string list))
243 (should (stringp string)))
244 (let* ((string "hello")
245 (vector (seq-into string 'vector)))
246 (should (same-contents-p string vector))
247 (should (stringp string)))
248 (let* ((list nil)
249 (vector (seq-into list 'vector)))
250 (should (same-contents-p list vector))
251 (should (vectorp vector))))
252
231(provide 'seq-tests) 253(provide 'seq-tests)
232;;; seq-tests.el ends here 254;;; seq-tests.el ends here