aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/subr-tests.el18
-rw-r--r--test/src/fns-tests.el18
2 files changed, 18 insertions, 18 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index 7465aac5ea5..c458eef2f93 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -318,24 +318,6 @@ cf. Bug#25477."
318 (should (eq (string-to-char (symbol-name (gensym))) ?g)) 318 (should (eq (string-to-char (symbol-name (gensym))) ?g))
319 (should (eq (string-to-char (symbol-name (gensym "X"))) ?X))) 319 (should (eq (string-to-char (symbol-name (gensym "X"))) ?X)))
320 320
321(ert-deftest subr-tests--proper-list-p ()
322 "Test `proper-list-p' behavior."
323 (dotimes (length 4)
324 ;; Proper and dotted lists.
325 (let ((list (make-list length 0)))
326 (should (= (proper-list-p list) length))
327 (should (not (proper-list-p (nconc list 0)))))
328 ;; Circular lists.
329 (dotimes (n (1+ length))
330 (let ((circle (make-list (1+ length) 0)))
331 (should (not (proper-list-p (nconc circle (nthcdr n circle))))))))
332 ;; Atoms.
333 (should (not (proper-list-p 0)))
334 (should (not (proper-list-p "")))
335 (should (not (proper-list-p [])))
336 (should (not (proper-list-p (make-bool-vector 0 nil))))
337 (should (not (proper-list-p (make-symbol "a")))))
338
339(ert-deftest subr-tests--assq-delete-all () 321(ert-deftest subr-tests--assq-delete-all ()
340 "Test `assq-delete-all' behavior." 322 "Test `assq-delete-all' behavior."
341 (cl-flet ((new-list-fn 323 (cl-flet ((new-list-fn
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index d6cc99e8e33..6ebab4287f7 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -648,4 +648,22 @@
648 (should (equal (list (eq a b) n len) 648 (should (equal (list (eq a b) n len)
649 (list t n len)))))))) 649 (list t n len))))))))
650 650
651(ert-deftest test-proper-list-p ()
652 "Test `proper-list-p' behavior."
653 (dotimes (length 4)
654 ;; Proper and dotted lists.
655 (let ((list (make-list length 0)))
656 (should (= (proper-list-p list) length))
657 (should (not (proper-list-p (nconc list 0)))))
658 ;; Circular lists.
659 (dotimes (n (1+ length))
660 (let ((circle (make-list (1+ length) 0)))
661 (should (not (proper-list-p (nconc circle (nthcdr n circle))))))))
662 ;; Atoms.
663 (should (not (proper-list-p 0)))
664 (should (not (proper-list-p "")))
665 (should (not (proper-list-p [])))
666 (should (not (proper-list-p (make-bool-vector 0 nil))))
667 (should (not (proper-list-p (make-symbol "a")))))
668
651(provide 'fns-tests) 669(provide 'fns-tests)