]> code.delx.au - gnu-emacs/blobdiff - test/automated/subr-tests.el
* lisp/emacs-lisp/package.el (package-unpack): Load before compiling
[gnu-emacs] / test / automated / subr-tests.el
index 85d5d112d9e80dc6bac80794cf65f946cfea2aac..ee8db593b498e9964e5c08f557b7d47ccc3b8e69 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 t
+                   (setq x (1+ x))
+                   x)))
+    (should (= x 2)))
   (should (equal (macroexpand-all '(when a b c d))
                  '(if a (progn b c d)))))