[Top][All Lists]

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

scratch/so-long 07d5828 1/2: fixup! Support 'preserved' variables and mi

From: Phil Sainty
Subject: scratch/so-long 07d5828 1/2: fixup! Support 'preserved' variables and minor modes in `so-long-mode'
Date: Mon, 11 Jan 2021 05:15:37 -0500 (EST)

branch: scratch/so-long
commit 07d5828da469d10c9a3ed7e55385fb84a06991eb
Author: Phil Sainty <psainty@orcon.net.nz>
Commit: Phil Sainty <psainty@orcon.net.nz>

    fixup! Support 'preserved' variables and minor modes in `so-long-mode'
 test/lisp/so-long-tests/so-long-tests-helpers.el | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/test/lisp/so-long-tests/so-long-tests-helpers.el 
index c7c4ef7..822b2ce 100644
--- a/test/lisp/so-long-tests/so-long-tests-helpers.el
+++ b/test/lisp/so-long-tests/so-long-tests-helpers.el
@@ -44,7 +44,7 @@
        (should (eq major-mode 'so-long-mode))
-       (so-long-tests-assert-preserved-modes-enabled))
+       (so-long-tests-assert-preserved))
        (should (eq so-long-minor-mode t))
@@ -64,7 +64,7 @@
        (should-not (eq major-mode 'so-long-mode))
-       (so-long-tests-assert-preserved-modes-enabled))
+       (so-long-tests-assert-preserved))
        (should-not (eq so-long-minor-mode t))
@@ -92,11 +92,16 @@
     (when (boundp (car ovar))
       (should (equal (symbol-value (car ovar)) (cdr ovar))))))
-(defun so-long-tests-assert-preserved-modes-enabled ()
-  "Assert that 'preserved' minor modes are still enabled."
-  (dolist (mode (so-long-original 'so-long-mode-preserved-minor-modes))
-    (when (and (boundp mode))
-      (should-not (eq mode nil)))))
+(defun so-long-tests-assert-preserved ()
+  "Assert that preserved modes and variables have their expected values."
+  (dolist (var so-long-mode-preserved-variables)
+    (when (boundp var)
+      (should (equal (symbol-value var)
+                     (alist-get var so-long-tests-memory)))))
+  (dolist (mode so-long-mode-preserved-minor-modes)
+    (when (boundp mode)
+      (should (equal (symbol-value mode)
+                     (alist-get mode so-long-tests-memory))))))
 (defun so-long-tests-remember ()
   "Remember the original states of modes and variables.

reply via email to

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