emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 846761e: Test mapcan


From: Mario Lang
Subject: [Emacs-diffs] master 846761e: Test mapcan
Date: Mon, 11 Jul 2016 20:12:29 +0000 (UTC)

branch: master
commit 846761e426ec4056b7d662adbe3ec4c80a7e8307
Author: Mario Lang <address@hidden>
Commit: Mario Lang <address@hidden>

    Test mapcan
    
    * test/src/fns-tests.el (fns-tests-mapcan): New test.
---
 test/src/fns-tests.el |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 8485896..c533bad 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -235,3 +235,13 @@
                    (backward-delete-char 1)
                    (buffer-hash))
                  (sha1 "foo"))))
+
+(ert-deftest fns-tests-mapcan ()
+  (should-error (mapcan))
+  (should-error (mapcan #'identity))
+  (should-error (mapcan #'identity (make-char-table 'foo)))
+  (should (equal (mapcan #'list '(1 2 3)) '(1 2 3)))
+  ;; `mapcan' is destructive
+  (let ((data '((foo) (bar))))
+    (should (equal (mapcan #'identity data) '(foo bar)))
+    (should (equal data                     '((foo bar) (bar))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]