[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 3dbbd1beff 293/313: Fix tests to run under
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 3dbbd1beff 293/313: Fix tests to run under Emacs 24.3. |
Date: |
Sat, 3 Dec 2022 10:59:39 -0500 (EST) |
branch: elpa/bash-completion
commit 3dbbd1beffdff7e390ca9292724886a4358a280d
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Fix tests to run under Emacs 24.3.
The order of results in Emacs 24 are not always consistent with other
Emacs versions.
---
test/bash-completion-integration-test.el | 33 +++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/test/bash-completion-integration-test.el
b/test/bash-completion-integration-test.el
index e6c2ffdf9b..3b74105d85 100644
--- a/test/bash-completion-integration-test.el
+++ b/test/bash-completion-integration-test.el
@@ -181,6 +181,16 @@ for testing completion."
(delete-directory test-env-dir 'recursive)
(dired-delete-file test-env-dir 'always))))
+(defun bash-completion_test-equal-any-order (expected actual)
+ "Compare a sorted list of string EXPECTED with ACTUAL.
+
+Ignore the order of the strings in ACTUAL.
+
+This is necessary, because the order of some results isn't stable
+across Emacs version."
+ (let ((actual (copy-tree actual)))
+ (equal expected (sort actual 'string<))))
+
(ert-deftest bash-completion-integration-setenv-test ()
(bash-completion_test-harness
""
@@ -238,8 +248,9 @@ for testing completion."
(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 (bash-completion_test-equal-any-order
+ '("some/directory/" "some/other/")
+ (bash-completion_test-candidates "ls some/")))
(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")))))
@@ -598,7 +609,8 @@ $ ")))))
;;
https://www.gnu.org/software/emacs/manual/html_node/elisp/Programmed-Completion.html
;; all-completion
- (should (equal '("some/file/" "some/filled/") (funcall compfunc-some
"some/" nil t)))
+ (should (bash-completion_test-equal-any-order
+ '("some/file/" "some/filled/") (funcall compfunc-some "some/"
nil t)))
(should (equal '("some/filled/") (funcall compfunc-some "some/fill" nil
t)))
(should (equal nil (funcall compfunc-some "other" nil t)))
(should (equal '("some/filled/") (funcall compfunc-one "some/fill" nil
t)))
@@ -609,8 +621,9 @@ $ ")))))
(lambda (c) (string= c "some/file/")) t)))
(should (equal nil
(funcall compfunc-some "some/" (lambda (c) nil) t)))
- (should (equal '("some/file/" "some/filled/")
- (funcall compfunc-some "some/" (lambda (c) t) t)))
+ (should (bash-completion_test-equal-any-order
+ '("some/file/" "some/filled/")
+ (funcall compfunc-some "some/" (lambda (c) t) t)))
;; try-completion
(should (equal "some/filled/" (funcall compfunc-one "some/fill" nil nil)))
@@ -667,8 +680,8 @@ $ ")))))
(ert-deftest bash-completion_test-dynamic-table-nonprefix ()
(bash-completion_test-with-shell-harness
(concat "function _myprog {\n"
- " COMPREPLY=( \"ba${COMP_WORDS[$COMP_CWORD]}tai\" \n"
- " \"ba${COMP_WORDS[$COMP_CWORD]}dai\" )\n"
+ " COMPREPLY=( \"ba${COMP_WORDS[$COMP_CWORD]}dai\" \n"
+ " \"ba${COMP_WORDS[$COMP_CWORD]}tai\" )\n"
"}\n"
"complete -F _myprog myprog\n")
nil ; use-separate-process
@@ -683,8 +696,10 @@ $ ")))))
;; text string, so the first time all-completion is called with
;; the current word, all completions are returned, even the one
;; that don't match the string as prefix.
- (should (equal '("babeetai" "babeedai") (funcall compfunc-nonprefix "bee"
nil t)))
- (should (equal '("babeetai" "babeedai") (funcall compfunc-nonprefix
"babee" nil t)))
+ (should (bash-completion_test-equal-any-order
+ '("babeedai" "babeetai") (funcall compfunc-nonprefix "bee" nil
t)))
+ (should (bash-completion_test-equal-any-order
+ '("babeedai" "babeetai") (funcall compfunc-nonprefix "babee" nil
t)))
(should (equal '("babeetai") (funcall compfunc-nonprefix "babeet" nil t)))
;; all-completion with predicate
- [nongnu] elpa/bash-completion b9e519e2ad 263/313: Fix typo, (continued)
- [nongnu] elpa/bash-completion b9e519e2ad 263/313: Fix typo, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2684ea9e46 264/313: Fix issue with case-insensitive completion., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6d74dd30ba 266/313: Avoid interference from PROMPT_COMMAND in single process mode., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 23a3402844 270/313: Trying to disable the warning on MacOS that breaks the tests., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1598101f06 271/313: Remove the fallback to a separate process., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 18ed1504ce 274/313: Add test cases for TRAMP shell., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 23dbe5b537 276/313: Change minimum supported Emacs version from 24.1 to 24.3., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c3797e0d09 277/313: Avoid running the same completion multiple times., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0210d346f1 279/313: Make bash-completion-use-separate-processes default to nil., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7a1f127851 292/313: Test and fix the dynamic table function that's returned., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3dbbd1beff 293/313: Fix tests to run under Emacs 24.3.,
ELPA Syncer <=
- [nongnu] elpa/bash-completion d47edb9d41 294/313: Bump version to 3.1, a bugfix release., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion faefaf6950 298/313: Add command M-x bash-completion-debug, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fa5557709e 300/313: GitHub Actions now runs tests on Emacs 27.1., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fd853663ee 304/313: Detect non-responsive processes more quickly., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 65e54c6f9c 307/313: Temporarily revert fixes for issue #44., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion d9c97b741d 309/313: Attempt to fix automated tests., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 29b5fc860a 312/313: Shorten overly long docstring (#53), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3ffc296e0b 149/313: Close opened quote for all completion candidate that don't end with a, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6bf1536325 150/313: Fix occasional escaping issue with candidates containing quotes., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7ce100b7eb 006/313: cursor position, ELPA Syncer, 2022/12/03