emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/so-long f76ba13: fixup! Add tests for so-long.el


From: Phil
Subject: [Emacs-diffs] scratch/so-long f76ba13: fixup! Add tests for so-long.el
Date: Sat, 15 Jun 2019 08:10:16 -0400 (EDT)

branch: scratch/so-long
commit f76ba1376096b1e8c46cc1974da4a0316fd279e1
Author: Phil Sainty <address@hidden>
Commit: Phil Sainty <address@hidden>

    fixup! Add tests for so-long.el
    
    Tests for using the `so-long' command, and for calling the major and
    minor modes directly (rather than via an action).
---
 test/lisp/so-long-tests/so-long-tests.el | 44 ++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/test/lisp/so-long-tests/so-long-tests.el 
b/test/lisp/so-long-tests/so-long-tests.el
index 3b35b64..6bc3119 100644
--- a/test/lisp/so-long-tests/so-long-tests.el
+++ b/test/lisp/so-long-tests/so-long-tests.el
@@ -151,6 +151,50 @@
         (so-long-revert)
         (so-long-tests-assert-reverted action)))))
 
+(ert-deftest so-long-tests-command-so-long ()
+  "Test using the `so-long' command."
+  (with-temp-buffer
+    (insert "#!emacs\n")
+    (normal-mode)
+    (so-long-tests-remember)
+    (insert (make-string (1+ so-long-threshold) ?x))
+    (so-long)
+    (so-long-tests-assert-active 'so-long-mode)
+    (so-long-revert)
+    (so-long-tests-assert-reverted 'so-long-mode))
+  (dolist (action (mapcar #'car so-long-action-alist))
+    (with-temp-buffer
+      (insert "#!emacs\n")
+      (normal-mode)
+      (so-long-tests-remember)
+      (insert (make-string (1+ so-long-threshold) ?x))
+      (so-long action)
+      (so-long-tests-assert-active action t)
+      (so-long-revert)
+      (so-long-tests-assert-reverted action t))))
+
+(ert-deftest so-long-tests-major-mode ()
+  "Test calling `so-long-mode' directly."
+  (with-temp-buffer
+    (insert "#!emacs\n")
+    (normal-mode)
+    (so-long-tests-remember)
+    (so-long-mode)
+    (so-long-tests-assert-active 'so-long-mode)
+    (so-long-revert)
+    (so-long-tests-assert-reverted 'so-long-mode)))
+
+(ert-deftest so-long-tests-minor-mode ()
+  "Test calling `so-long-minor-mode' directly."
+  (with-temp-buffer
+    (insert "#!emacs\n")
+    (normal-mode)
+    (so-long-tests-remember)
+    (so-long-minor-mode 1)
+    (so-long-tests-assert-active 'so-long-minor-mode t)
+    (so-long-minor-mode 0)
+    (so-long-tests-assert-reverted 'so-long-minor-mode t)))
+
 (ert-deftest so-long-tests-target-modes ()
   "Targeted major modes."
   (with-temp-buffer



reply via email to

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