[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 07e8ff7 1/2: Move cl-lib tests for caaXr to subr-tests.el
From: |
Stefan Kangas |
Subject: |
master 07e8ff7 1/2: Move cl-lib tests for caaXr to subr-tests.el |
Date: |
Fri, 3 Sep 2021 02:24:36 -0400 (EDT) |
branch: master
commit 07e8ff7f0f35160953c2666f2ee4863852e0453f
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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.
---
test/lisp/emacs-lisp/cl-lib-tests.el | 16 ----------------
test/lisp/subr-tests.el | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el
b/test/lisp/emacs-lisp/cl-lib-tests.el
index a5ec62b..a132d73 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 c1f8225..54bee7b 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -62,6 +62,25 @@
(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.
(ert-deftest subr-test-kbd ()