aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorMario Lang2016-07-11 21:43:48 +0200
committerMario Lang2016-07-11 21:43:48 +0200
commit846761e426ec4056b7d662adbe3ec4c80a7e8307 (patch)
tree694514486ff82022364e7b9edd948fb1923d012f /test/src
parent69b79bdff07bff2174d782dc4c69cf2dadc8225b (diff)
downloademacs-846761e426ec4056b7d662adbe3ec4c80a7e8307.tar.gz
emacs-846761e426ec4056b7d662adbe3ec4c80a7e8307.zip
Test mapcan
* test/src/fns-tests.el (fns-tests-mapcan): New test.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fns-tests.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 848589692ea..c533bad3cdc 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -235,3 +235,13 @@
235 (backward-delete-char 1) 235 (backward-delete-char 1)
236 (buffer-hash)) 236 (buffer-hash))
237 (sha1 "foo")))) 237 (sha1 "foo"))))
238
239(ert-deftest fns-tests-mapcan ()
240 (should-error (mapcan))
241 (should-error (mapcan #'identity))
242 (should-error (mapcan #'identity (make-char-table 'foo)))
243 (should (equal (mapcan #'list '(1 2 3)) '(1 2 3)))
244 ;; `mapcan' is destructive
245 (let ((data '((foo) (bar))))
246 (should (equal (mapcan #'identity data) '(foo bar)))
247 (should (equal data '((foo bar) (bar))))))