From 846761e426ec4056b7d662adbe3ec4c80a7e8307 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Mon, 11 Jul 2016 21:43:48 +0200 Subject: [PATCH] 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 848589692e..c533bad3cd 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)))))) -- 2.39.2