]> code.delx.au - gnu-emacs/commitdiff
* test/automated/subr-tests.el (subr-test-when): Fix test
authorArtur Malabarba <bruce.connor.am@gmail.com>
Fri, 6 Nov 2015 11:18:23 +0000 (11:18 +0000)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Fri, 6 Nov 2015 11:18:23 +0000 (11:18 +0000)
test/automated/subr-tests.el

index 85d5d112d9e80dc6bac80794cf65f946cfea2aac..e782f7b1ee1150a27d277dab687f272a5448eab7 100644 (file)
   (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)))))