aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/ert-tests.el42
-rw-r--r--test/lisp/subr-tests.el18
2 files changed, 18 insertions, 42 deletions
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index e92b4342748..cb957bd9fd6 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -496,48 +496,6 @@ This macro is used to test if macroexpansion in `should' works."
496 496
497 497
498;;; Tests for utility functions. 498;;; Tests for utility functions.
499(ert-deftest ert-test-proper-list-p ()
500 (should (ert--proper-list-p '()))
501 (should (ert--proper-list-p '(1)))
502 (should (ert--proper-list-p '(1 2)))
503 (should (ert--proper-list-p '(1 2 3)))
504 (should (ert--proper-list-p '(1 2 3 4)))
505 (should (not (ert--proper-list-p 'a)))
506 (should (not (ert--proper-list-p '(1 . a))))
507 (should (not (ert--proper-list-p '(1 2 . a))))
508 (should (not (ert--proper-list-p '(1 2 3 . a))))
509 (should (not (ert--proper-list-p '(1 2 3 4 . a))))
510 (let ((a (list 1)))
511 (setf (cdr (last a)) a)
512 (should (not (ert--proper-list-p a))))
513 (let ((a (list 1 2)))
514 (setf (cdr (last a)) a)
515 (should (not (ert--proper-list-p a))))
516 (let ((a (list 1 2 3)))
517 (setf (cdr (last a)) a)
518 (should (not (ert--proper-list-p a))))
519 (let ((a (list 1 2 3 4)))
520 (setf (cdr (last a)) a)
521 (should (not (ert--proper-list-p a))))
522 (let ((a (list 1 2)))
523 (setf (cdr (last a)) (cdr a))
524 (should (not (ert--proper-list-p a))))
525 (let ((a (list 1 2 3)))
526 (setf (cdr (last a)) (cdr a))
527 (should (not (ert--proper-list-p a))))
528 (let ((a (list 1 2 3 4)))
529 (setf (cdr (last a)) (cdr a))
530 (should (not (ert--proper-list-p a))))
531 (let ((a (list 1 2 3)))
532 (setf (cdr (last a)) (cddr a))
533 (should (not (ert--proper-list-p a))))
534 (let ((a (list 1 2 3 4)))
535 (setf (cdr (last a)) (cddr a))
536 (should (not (ert--proper-list-p a))))
537 (let ((a (list 1 2 3 4)))
538 (setf (cdr (last a)) (cl-cdddr a))
539 (should (not (ert--proper-list-p a)))))
540
541(ert-deftest ert-test-parse-keys-and-body () 499(ert-deftest ert-test-parse-keys-and-body ()
542 (should (equal (ert--parse-keys-and-body '(foo)) '(nil (foo)))) 500 (should (equal (ert--parse-keys-and-body '(foo)) '(nil (foo))))
543 (should (equal (ert--parse-keys-and-body '(:bar foo)) '((:bar foo) nil))) 501 (should (equal (ert--parse-keys-and-body '(:bar foo)) '((:bar foo) nil)))
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index 52b61d9fb97..86938d5dbe0 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -306,6 +306,24 @@ cf. Bug#25477."
306 (should (eq (string-to-char (symbol-name (gensym))) ?g)) 306 (should (eq (string-to-char (symbol-name (gensym))) ?g))
307 (should (eq (string-to-char (symbol-name (gensym "X"))) ?X))) 307 (should (eq (string-to-char (symbol-name (gensym "X"))) ?X)))
308 308
309(ert-deftest subr-tests--proper-list-p ()
310 "Test `proper-list-p' behavior."
311 (dotimes (length 4)
312 ;; Proper and dotted lists.
313 (let ((list (make-list length 0)))
314 (should (= (proper-list-p list) length))
315 (should (not (proper-list-p (nconc list 0)))))
316 ;; Circular lists.
317 (dotimes (n (1+ length))
318 (let ((circle (make-list (1+ length) 0)))
319 (should (not (proper-list-p (nconc circle (nthcdr n circle))))))))
320 ;; Atoms.
321 (should (not (proper-list-p 0)))
322 (should (not (proper-list-p "")))
323 (should (not (proper-list-p [])))
324 (should (not (proper-list-p (make-bool-vector 0 nil))))
325 (should (not (proper-list-p (make-symbol "a")))))
326
309(ert-deftest subr-tests--assq-delete-all () 327(ert-deftest subr-tests--assq-delete-all ()
310 "Test `assq-delete-all' behavior." 328 "Test `assq-delete-all' behavior."
311 (cl-flet ((new-list-fn 329 (cl-flet ((new-list-fn