emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 175efec 3/8: Add a nativecomp testcase


From: Andrea Corallo
Subject: feature/native-comp 175efec 3/8: Add a nativecomp testcase
Date: Wed, 11 Nov 2020 19:03:06 -0500 (EST)

branch: feature/native-comp
commit 175efec0732fc7317a444a2005f7b968a972b8e6
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    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 35df46a..1b0f305 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 48687d9..8bedad5 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. ;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]