emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 9b91262: * test/automated/subr-tests.el (subr-test-


From: Artur Malabarba
Subject: [Emacs-diffs] master 9b91262: * test/automated/subr-tests.el (subr-test-when): Fix test
Date: Fri, 06 Nov 2015 11:18:31 +0000

branch: master
commit 9b912623ad9032267106b134dd04e620c2b6c0a1
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    * test/automated/subr-tests.el (subr-test-when): Fix test
---
 test/automated/subr-tests.el |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/test/automated/subr-tests.el b/test/automated/subr-tests.el
index 85d5d11..e782f7b 100644
--- a/test/automated/subr-tests.el
+++ b/test/automated/subr-tests.el
@@ -91,8 +91,15 @@
   (should (equal (when t 'x 2) 2))
   (should (equal (when nil 'x 1) nil))
   (should (equal (when nil 'x 2) nil))
-  (should (equal (macroexpand-all '(when a b))
-                 '(if a b)))
+  (let ((x 1))
+    (should-not (when nil
+                  (setq x (1+ x))
+                  x))
+    (should (= x 1))
+    (should (= 2 (when true
+                   (setq x (1+ x))
+                   x)))
+    (should (= x 2)))
   (should (equal (macroexpand-all '(when a b c d))
                  '(if a (progn b c d)))))
 



reply via email to

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