From 175efec0732fc7317a444a2005f7b968a972b8e6 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Wed, 11 Nov 2020 16:17:03 +0100 Subject: [PATCH] Add a nativecomp testcase Having this while re-debugging the boostrap would have saved few hours of debug so let's add it. * test/src/comp-tests.el (and-3): Add test. * test/src/comp-test-funcs.el (comp-test-and-3-var): New var. (comp-test-and-3-f): New function. --- test/src/comp-test-funcs.el | 6 ++++++ test/src/comp-tests.el | 4 ++++ 2 files changed, 10 insertions(+) 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. ;; -- 2.39.5