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

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

[nongnu] elpa/bash-completion 42630fe6cc 254/313: Fix test case to cover


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 42630fe6cc 254/313: Fix test case to cover substring completion.
Date: Sat, 3 Dec 2022 10:59:35 -0500 (EST)

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

    Fix test case to cover substring completion.
    
    This covers complex completions that require the substring completion
    style to be enabled.
---
 test/bash-completion-integration-test.el | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/test/bash-completion-integration-test.el 
b/test/bash-completion-integration-test.el
index b501be6b15..e2fe939ef7 100644
--- a/test/bash-completion-integration-test.el
+++ b/test/bash-completion-integration-test.el
@@ -333,21 +333,19 @@ for testing completion."
                 "sometimes_not_nospace dummyo"
                 (bash-completion_test-complete "sometimes_not_nospace 
dum")))))))
 
-(ert-deftest bash-completion-integration-bash-4-complex-completion ()
+(ert-deftest bash-completion-integration-bash-4-substring-completion ()
   (bash-completion_test-with-shell-harness
    (concat ; .bashrc
     "function _myprog {\n"
     "  COMPREPLY=( \"ba${COMP_WORDS[$COMP_CWORD]}ta\" )\n"
-    "  COMPREPLY+=( \"ba${COMP_WORDS[$COMP_CWORD]}to\" )\n"
     "}\n"
     "complete -F _myprog myprog\n")
    t ; bash-completion-use-separate-processes
-   ;; The default completion engine doesn't support replacing the word
-   ;; to complete with candidates and will ignore all candidates, but
-   ;; other completions engines do support it, so it's worth returning
-   ;; them - but we can't use bash-completion_test-complete.
-   (should (equal '("batitita" "batitito")
-                  (bash-completion_test-candidates "myprog blah titi")))))
+   (let ((completion-in-region-function 'completion--in-region)
+         (completion-styles '(basic partial-completion substring emacs22)))
+     (should (equal
+              "myprog blah batitita "
+              (bash-completion_test-complete "myprog blah titi"))))))
 
 (ert-deftest bash-completion-integration-vioption-single-process-test ()
   (bash-completion_test--with-bash-option "set -o vi" nil))



reply via email to

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