From: Stefan Kangas Date: Wed, 28 Jul 2021 11:31:40 +0000 (+0200) Subject: Move cl-lib tests for caaXr to subr-tests.el X-Git-Tag: emacs-28.0.90~1210 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=07e8ff7f0f35160953c2666f2ee4863852e0453f;p=emacs.git Move cl-lib tests for caaXr to subr-tests.el * test/lisp/emacs-lisp/cl-lib-tests.el (cl-test-caaar) (cl-test-caadr): Move tests using a cl-lib alias from here... * test/lisp/subr-tests.el (subr-test-caaar, subr-test-caadr): ...to here. The functions under test are in subr.el. --- diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index a5ec62b9c42..a132d736383 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -417,22 +417,6 @@ (should-error (cl-nth-value -1 (cl-values 2 3)) :type 'args-out-of-range) (should (string= (cl-nth-value 0 "only lists") "only lists"))) -(ert-deftest cl-test-caaar () - (should (null (cl-caaar '()))) - (should (null (cl-caaar '(() (2))))) - (should (null (cl-caaar '((() (2)) (a b))))) - (should-error (cl-caaar '(1 2)) :type 'wrong-type-argument) - (should-error (cl-caaar '((1 2))) :type 'wrong-type-argument) - (should (= 1 (cl-caaar '(((1 2) (3 4)))))) - (should (null (cl-caaar '((() (3 4))))))) - -(ert-deftest cl-test-caadr () - (should (null (cl-caadr '()))) - (should (null (cl-caadr '(1)))) - (should-error (cl-caadr '(1 2)) :type 'wrong-type-argument) - (should (= 2 (cl-caadr '(1 (2 3))))) - (should (equal '((2) (3)) (cl-caadr '((1) (((2) (3))) (4)))))) - (ert-deftest cl-test-ldiff () (let ((l '(1 2 3))) (should (null (cl-ldiff '() '()))) diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index c1f8225ec8a..54bee7bc757 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -61,6 +61,25 @@ (quote (0 font-lock-keyword-face)))))))) + +;;;; List functions. + +(ert-deftest subr-test-caaar () + (should (null (caaar '()))) + (should (null (caaar '(() (2))))) + (should (null (caaar '((() (2)) (a b))))) + (should-error (caaar '(1 2)) :type 'wrong-type-argument) + (should-error (caaar '((1 2))) :type 'wrong-type-argument) + (should (= 1 (caaar '(((1 2) (3 4)))))) + (should (null (caaar '((() (3 4))))))) + +(ert-deftest subr-test-caadr () + (should (null (caadr '()))) + (should (null (caadr '(1)))) + (should-error (caadr '(1 2)) :type 'wrong-type-argument) + (should (= 2 (caadr '(1 (2 3))))) + (should (equal '((2) (3)) (caadr '((1) (((2) (3))) (4)))))) + ;;;; Keymap support.