From 9b912623ad9032267106b134dd04e620c2b6c0a1 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Fri, 6 Nov 2015 11:18:23 +0000 Subject: [PATCH] * test/automated/subr-tests.el (subr-test-when): Fix test --- test/automated/subr-tests.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/automated/subr-tests.el b/test/automated/subr-tests.el index 85d5d112d9e..e782f7b1ee1 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))))) -- 2.39.5