emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/lua-mode 8d27d2c 268/468: fixed up tests && improved lua-k


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 8d27d2c 268/468: fixed up tests && improved lua-kill-process
Date: Thu, 5 Aug 2021 04:58:50 -0400 (EDT)

branch: elpa/lua-mode
commit 8d27d2c37aedbcfcffc82c5808d6baeae3258753
Author: xristos <xristos@sdf.lonestar.org>
Commit: xristos <xristos@sdf.lonestar.org>

    fixed up tests && improved lua-kill-process
---
 lua-mode.el           |  5 ++---
 test/inferior-test.el | 13 ++++++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/lua-mode.el b/lua-mode.el
index 31dca83..0fd4178 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1666,9 +1666,8 @@ When called interactively, switch to the process buffer."
 (defun lua-kill-process ()
   "Kill lua subprocess and its buffer."
   (interactive)
-  (when lua-process-buffer
-    (kill-buffer lua-process-buffer)
-    (setq lua-process-buffer nil)))
+  (when (buffer-live-p lua-process-buffer)
+    (kill-buffer lua-process-buffer)))
 
 (defun lua-set-lua-region-start (&optional arg)
   "Set start of region for use with `lua-send-lua-region'."
diff --git a/test/inferior-test.el b/test/inferior-test.el
index 34fbdbf..9e4a35c 100644
--- a/test/inferior-test.el
+++ b/test/inferior-test.el
@@ -6,22 +6,25 @@
 
 
 (ert-deftest lua-hide-process-buffer-doesnt-switch-current-window ()
-  :expected-result :failed
-
   (with-lua-buffer
    (let ((cur-buf (current-buffer)))
      (should (get-buffer-window cur-buf))
-
+     (lua-start-process)
      (lua-hide-process-buffer)
      (should (get-buffer-window cur-buf)))))
 
 (ert-deftest lua-hide-process-buffer-doesnt-signal-on-killed-process ()
-  :expected-result :failed
   (with-lua-buffer
    (let ((cur-buf (current-buffer)))
      (lua-start-process)
      (lua-kill-process)
-
      (lua-hide-process-buffer)
      (should (get-buffer-window cur-buf)))))
 
+(ert-deftest lua-hide-process-buffer-standalone ()
+  (with-lua-buffer
+    (let ((cur-buf (current-buffer)))
+      ;; lua-process-buffer should be nil
+      (lua-hide-process-buffer)
+      (should (get-buffer-window cur-buf)))))
+         



reply via email to

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