diff options
| author | Mario Lang | 2016-07-11 21:43:48 +0200 |
|---|---|---|
| committer | Mario Lang | 2016-07-11 21:43:48 +0200 |
| commit | 846761e426ec4056b7d662adbe3ec4c80a7e8307 (patch) | |
| tree | 694514486ff82022364e7b9edd948fb1923d012f /test/src | |
| parent | 69b79bdff07bff2174d782dc4c69cf2dadc8225b (diff) | |
| download | emacs-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.el | 10 |
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)))))) | ||