summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/src/comp-test-funcs.el6
-rw-r--r--test/src/comp-tests.el4
2 files changed, 10 insertions, 0 deletions
diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el
index 35df46a9b84..1b0f3056b98 100644
--- a/test/src/comp-test-funcs.el
+++ b/test/src/comp-test-funcs.el
@@ -348,6 +348,12 @@
(defsubst comp-test-defsubst-f ()
t)
+(defvar comp-test-and-3-var 1)
+(defun comp-test-and-3-f (x)
+ (and (atom x)
+ comp-test-and-3-var
+ 2))
+
;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests ;;
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 48687d92021..8bedad5db73 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -440,6 +440,10 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
'(lambda ()
(delete-region (point-min) (point-max))))))))
+(comp-deftest and-3 ()
+ (should (= (comp-test-and-3-f t) 2))
+ (should (null (comp-test-and-3-f '(1 2)))))
+
;;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests. ;;