aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/subr-tests.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index f218a7663e0..08f9a697a3c 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -372,5 +372,22 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350."
372 (shell-quote-argument "%ca%"))) 372 (shell-quote-argument "%ca%")))
373 "without-caret %ca%")))) 373 "without-caret %ca%"))))
374 374
375(ert-deftest subr-tests-flatten-tree ()
376 "Test `flatten-tree' behavior."
377 (should (equal (flatten-tree '(1 (2 . 3) nil (4 5 (6)) 7))
378 '(1 2 3 4 5 6 7)))
379 (should (equal (flatten-tree '((1 . 2)))
380 '(1 2)))
381 (should (equal (flatten-tree '(1 nil 2))
382 '(1 2)))
383 (should (equal (flatten-tree 42)
384 '(42)))
385 (should (equal (flatten-tree t)
386 '(t)))
387 (should (equal (flatten-tree nil)
388 nil))
389 (should (equal (flatten-tree '(1 ("foo" "bar") 2))
390 '(1 "foo" "bar" 2))))
391
375(provide 'subr-tests) 392(provide 'subr-tests)
376;;; subr-tests.el ends here 393;;; subr-tests.el ends here