aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBasil L. Contovounesios2019-04-09 17:05:27 +0100
committerBasil L. Contovounesios2019-04-12 14:25:36 +0100
commit0c4c96d7dc660ae8fa26c397bafff228996bcc51 (patch)
tree8d32e4cc0a8cb2177fa15b02b7f4d2b0b90e24d5
parent9a54e70c184cd9f65f1141a1b1df87e9afb83d2f (diff)
downloademacs-0c4c96d7dc660ae8fa26c397bafff228996bcc51.tar.gz
emacs-0c4c96d7dc660ae8fa26c397bafff228996bcc51.zip
Move proper-list-p tests to fns-tests.el
This follows the move of proper-list-p from lisp/subr.el to src/fns.c in 2018-07-24T15:58:46-07:00!eggert@cs.ucla.edu. * test/lisp/subr-tests.el (subr-tests--proper-list-p): Move from here... * test/src/fns-tests.el (test-proper-list-p): ...to here.
-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)