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

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

[nongnu] elpa/bash-completion 102316ebf9 117/313: Test bash-completion-d


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 102316ebf9 117/313: Test bash-completion-dynamic-complete-standard
Date: Sat, 3 Dec 2022 10:59:22 -0500 (EST)

branch: elpa/bash-completion
commit 102316ebf9f3c39dfe4bc6d5751084f6a54d2741
Author: Stephane Zermatten <stephane@boomer.local>
Commit: Stephane Zermatten <stephane@boomer.local>

    Test bash-completion-dynamic-complete-standard
    instead of bash-completion-dynamic-complete-legacy.
---
 bash-completion-test.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/bash-completion-test.el b/bash-completion-test.el
index fcfe392127..f4f68ad1df 100644
--- a/bash-completion-test.el
+++ b/bash-completion-test.el
@@ -619,9 +619,12 @@ garbage
            ;; do a completion and return the result
            (with-current-buffer shell-buffer
              (insert ,complete-me)
-             (let ((start (point)))
-               (bash-completion-dynamic-complete-legacy)
-               (buffer-substring-no-properties start (point-max)))))
+             (let ((result (bash-completion-dynamic-complete-standard)))
+               ;; (start end completions)
+               ;; start and end depend on the prompt length, so just return:
+               ;; ((- end start) completion)
+               (list (- (nth 1 result) (nth 0 result))
+                     (nth 2 result)))))
        ;; finally
        (when (and shell-buffer (buffer-live-p shell-buffer))
          (with-current-buffer shell-buffer
@@ -656,14 +659,13 @@ garbage
              (buffer-string))))))
 
 (ert-deftest bash-completion-one-completion-test ()
-  ;; TODO: Fix this test. It is flakey because of timing issues. 
-  (should (bash-completion-ends-with
-          (bash-completion_test-with-shell "__bash_complete_")
-          "__bash_complete_wrapper ")))
+  (should (equal '(16 ("__bash_complete_wrapper "
+                      ;; TODO: again, why is this duplicated?
+                      "__bash_complete_wrapper "))
+                (bash-completion_test-with-shell "__bash_complete_"))))
 
 (ert-deftest bash-completion-wordbreak-completion-test ()
-  (should (bash-completion-ends-with
-          (bash-completion_test-with-shell "export PATH=/sbin:/bi")
-          "export PATH=/sbin:/bin/")))
+  (should (equal '(3 ("/bin/"))
+                (bash-completion_test-with-shell "export PATH=/sbin:/bi"))))
 
 ;;; bash-completion_test.el ends here



reply via email to

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