emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 79162cb 4/5: Fix subr-x-tests when running from e


From: Noam Postavsky
Subject: [Emacs-diffs] emacs-26 79162cb 4/5: Fix subr-x-tests when running from elc
Date: Mon, 25 Sep 2017 19:40:15 -0400 (EDT)

branch: emacs-26
commit 79162cb0db1b62eec35f4fec0e6eac8669bc8f37
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Fix subr-x-tests when running from elc
    
    * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-and-let*-test-group-1):
    Use `eval' around the `should-error' cases.
---
 test/lisp/emacs-lisp/subr-x-tests.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/test/lisp/emacs-lisp/subr-x-tests.el 
b/test/lisp/emacs-lisp/subr-x-tests.el
index 2c6740a..0e8871d 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -397,9 +397,14 @@
    (should (equal 1 (let ((x 1)) (and-let* (x)))))
    (should (equal nil (and-let* ((x nil)))))
    (should (equal 1 (and-let* ((x 1)))))
-   (should-error (and-let* (nil (x 1))) :type 'setting-constant)
+   ;; The error doesn't trigger when compiled: the compiler will give
+   ;; a warning and then drop the erroneous code.  Therefore, use
+   ;; `eval' to avoid compilation.
+   (should-error (eval '(and-let* (nil (x 1))) lexical-binding)
+                 :type 'setting-constant)
    (should (equal nil (and-let* ((nil) (x 1)))))
-   (should-error (and-let* (2 (x 1))) :type 'wrong-type-argument)
+   (should-error (eval (and-let* (2 (x 1))) lexical-binding)
+                 :type 'wrong-type-argument)
    (should (equal 1 (and-let* ((2) (x 1)))))
    (should (equal 2 (and-let* ((x 1) (2)))))
    (should (equal nil (let ((x nil)) (and-let* (x) x))))



reply via email to

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