aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/src/fns-tests.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 57594572094..2d641cc3111 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -430,6 +430,23 @@
430 (buffer-hash)) 430 (buffer-hash))
431 (sha1 "foo")))) 431 (sha1 "foo"))))
432 432
433(ert-deftest fns-tests-mapconcat ()
434 (should (string= (mapconcat #'identity '()) ""))
435 (should (string= (mapconcat #'identity '("a" "b")) "ab"))
436 (should (string= (mapconcat #'identity '() "_") ""))
437 (should (string= (mapconcat #'identity '("A") "_") "A"))
438 (should (string= (mapconcat #'identity '("A" "B") "_") "A_B"))
439 (should (string= (mapconcat #'identity '("A" "B" "C") "_") "A_B_C"))
440 ;; non-ASCII strings
441 (should (string= (mapconcat #'identity '("Ä" "ø" "☭" "தமிழ்") "_漢字_")
442 "Ä_漢字_ø_漢字_☭_漢字_தமிழ்"))
443 ;; vector
444 (should (string= (mapconcat #'identity ["a" "b"] "") "ab"))
445 ;; bool-vector
446 (should (string= (mapconcat #'identity [nil nil] "") ""))
447 (should-error (mapconcat #'identity [nil nil t])
448 :type 'wrong-type-argument))
449
433(ert-deftest fns-tests-mapcan () 450(ert-deftest fns-tests-mapcan ()
434 (should-error (mapcan)) 451 (should-error (mapcan))
435 (should-error (mapcan #'identity)) 452 (should-error (mapcan #'identity))