branch: elpa/lua-mode
commit 8d27d2c37aedbcfcffc82c5808d6baeae3258753
Author: xristos <[email protected]>
Commit: xristos <[email protected]>

    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