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

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

[nongnu] elpa/lua-mode 2cdfda7 264/468: Add inferior-test.el with some b


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 2cdfda7 264/468: Add inferior-test.el with some basic (failing) tests
Date: Thu, 5 Aug 2021 04:58:50 -0400 (EDT)

branch: elpa/lua-mode
commit 2cdfda7583257807124fd36e67396ed3de79a55f
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>

    Add inferior-test.el with some basic (failing) tests
---
 Makefile              |  1 +
 test/inferior-test.el | 27 +++++++++++++++++++++++++++
 test/test-helper.el   |  2 ++
 3 files changed, 30 insertions(+)

diff --git a/Makefile b/Makefile
index 2c946fb..48c9385 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ TESTS += test/electric-mode-test.el
 TESTS += test/indentation-test.el
 TESTS += test/strings-and-comments-test.el
 TESTS += test/generic-test.el
+TESTS += test/inferior-test.el
 
 default:
        @echo version is $(VERSION)
diff --git a/test/inferior-test.el b/test/inferior-test.el
new file mode 100644
index 0000000..34fbdbf
--- /dev/null
+++ b/test/inferior-test.el
@@ -0,0 +1,27 @@
+;; lua-mode tests for inferior process handling
+
+(load (concat (file-name-directory (or load-file-name (buffer-file-name)
+                                       default-directory))
+              "test-helper.el") nil 'nomessage 'nosuffix)
+
+
+(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-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)))))
+
diff --git a/test/test-helper.el b/test/test-helper.el
index 6c1a87e..3c407ba 100644
--- a/test/test-helper.el
+++ b/test/test-helper.el
@@ -59,6 +59,8 @@ This is a mere typing/reading aid for lua-mode's font-lock 
tests."
 
 (defmacro with-lua-buffer (&rest body)
   `(with-temp-buffer
+     (set (make-local-variable 'lua-process) nil)
+     (set (make-local-variable 'lua-process-buffer) nil)
      (switch-to-buffer (current-buffer))
      (lua-mode)
      (font-lock-fontify-buffer)



reply via email to

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