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

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

[nongnu] elpa/bash-completion 1c6b2efb67 040/313: enormous test


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 1c6b2efb67 040/313: enormous test
Date: Sat, 3 Dec 2022 10:59:14 -0500 (EST)

branch: elpa/bash-completion
commit 1c6b2efb677ed2dd71737a0d43ddf503497aecff
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    enormous test
---
 bash-completion_test.el | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/bash-completion_test.el b/bash-completion_test.el
index 1239869ea2..11a8de0161 100644
--- a/bash-completion_test.el
+++ b/bash-completion_test.el
@@ -459,6 +459,26 @@ garbage
                (kill-buffer buffer)))
          (error (message "error in bash-completion_test tearDown: %s" err))))))
 
+  (defmacro bash-completion_test-with-shell (&rest body)
+    `(bash-completion_test-harness
+       (let ((shell-buffer nil)
+             (explicit-shell-file-name bash-completion-prog))
+         (unwind-protect
+             (progn
+               (setq shell-buffer (shell (generate-new-buffer-name 
"*bash-completion_test-with-shell*")))
+               ;; accept process output until there's nothing left
+               (while (accept-process-output nil 0.6))
+               ;; do a completion and return the result
+               (with-current-buffer shell-buffer
+                 (let ((start (point)))
+                   (progn ,@body)
+                   (buffer-substring-no-properties start (point-max)))))
+           ;; finally
+           (when (and shell-buffer (buffer-live-p shell-buffer))
+             (with-current-buffer shell-buffer
+               (insert "\nexit\n"))
+             (kill-buffer shell-buffer))))))
+
   (put 'bash-completion-regress-integration 'regression-suite t)
   (setq bash-completion-regress-integration '(
        ("bash-completion interaction"
@@ -483,6 +503,13 @@ garbage
           (buffer-string)))
        "t\n")
 
+       ("bash-completion execute one completion"
+       (bash-completion_test-with-shell
+        (let ((start (point)))
+          (insert "__bash_complete_")
+          (bash-completion-dynamic-complete)))
+       "__bash_complete_wrapper ")
+
        )))
 
 ;; Run diagnostics when this module is evaluated or compiled



reply via email to

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