[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 4c216c4eea 286/313: Add an integration tes
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 4c216c4eea 286/313: Add an integration test to cover multiple completion results. |
Date: |
Sat, 3 Dec 2022 10:59:38 -0500 (EST) |
branch: elpa/bash-completion
commit 4c216c4eeaeb7f92e27accd518bd4c61200e833e
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Add an integration test to cover multiple completion results.
---
test/bash-completion-integration-test.el | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/test/bash-completion-integration-test.el
b/test/bash-completion-integration-test.el
index 1e227d8082..1a41dc3f47 100644
--- a/test/bash-completion-integration-test.el
+++ b/test/bash-completion-integration-test.el
@@ -142,11 +142,16 @@
(or end (point-max))))
(defun bash-completion_test-candidates (complete-me)
- "Complete COMPLETE-ME and returns the candidates."
+ "Complete COMPLETE-ME and returns the candidates.
+
+The result is sorted to avoid hardcoding arbitrary order in the test."
(goto-char (point-max))
(delete-region (line-beginning-position) (line-end-position))
(insert complete-me)
- (nth 2 (bash-completion-dynamic-complete-nocomint)))
+ (sort
+ (nth 2 (bash-completion-dynamic-complete-nocomint
+ (line-beginning-position) (point) nil))
+ 'string<))
(defun bash-completion_test-setup-env (bashrc)
"Sets up a directory that contains a bashrc file other files
@@ -224,6 +229,23 @@ for testing completion."
(bash-completion_test-complete
"export SOMEPATH=some/directory:some/oth")))))
+(ert-deftest bash-completion-integration-multiple-completions-test ()
+ (bash-completion_test-multiple-completions-test ""))
+
+(ert-deftest bash-completion-integration-multiple-completions-prog-test ()
+ (bash-completion_test-multiple-completions-test
+ (concat "source " bash-completion_test-setup-completion "\n")))
+
+(defun bash-completion_test-multiple-completions-test (bashrc)
+ (bash-completion_test-with-shell-harness
+ bashrc
+ nil ; use-separate-process
+ (should (equal '("some/directory/" "some/other/")
+ (sort (bash-completion_test-candidates "ls some/")
'string<)))
+ (should (equal '("some/directory/") (bash-completion_test-candidates "ls
some/d")))
+ (should (equal '("some/directory/") (bash-completion_test-candidates "ls
some/di")))
+ (should (equal '() (bash-completion_test-candidates "ls some/do")))))
+
(ert-deftest bash-completion-integration-nocomint-test ()
(bash-completion_test-harness
"function somefunction { echo ok; }\n"
- [nongnu] elpa/bash-completion 2b9eba14fa 261/313: Update README.md, (continued)
- [nongnu] elpa/bash-completion 2b9eba14fa 261/313: Update README.md, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 79ce50bec9 262/313: Update README.md title, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 5e623ac270 275/313: Revert "Add test cases for TRAMP shell.", ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 702859f319 278/313: Cleanup strings containing bash commands., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 19d4fec42f 280/313: Use && instead of ; after cd, so completion fails if cd fails., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c584d4936b 281/313: Explicitly ignore error from the history command., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion de033933bd 282/313: Chain function definitions with && during setup., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e24a596631 283/313: Make integration tests stabler., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 51c7770758 284/313: Fix and update README.md, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c6decb1d6c 285/313: Avoid escaping all non-ASCII characters., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4c216c4eea 286/313: Add an integration test to cover multiple completion results.,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 8f877dc2ce 287/313: Let bash compute COMP_POINT, always at the end of COMP_LINE., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 377969faa7 288/313: Fix typos in README.md, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 72e9fce93d 291/313: Properly apply filter passed to the dynamic completion function., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 35d38fd3dc 295/313: Workaround for output containing \r\n instead of \n., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 666244383e 296/313: Workaround for command-line being echoed., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion abb72c36b8 297/313: Merge branch 'master' of github.com:szermatt/emacs-bash-completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e35943f37e 299/313: Fix backward-compatibility issue on 24.3: avoid using alist-get., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion abbe3bc268 301/313: Cleanup implementation of bash-completion-debug., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ca4fbce016 305/313: Turn off bash completion when non-bash prompts are detected., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion abe93ae2f6 308/313: Fix whitespace (#47), ELPA Syncer, 2022/12/03