diff options
| author | Stefan Monnier | 2019-11-26 13:18:18 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2019-11-26 13:18:18 -0500 |
| commit | 384d1c47cec8e61d1896694b14fcf88710f9dc4d (patch) | |
| tree | 0f0f94811898dde4d2bee1f24e3d9d8619446d37 | |
| parent | d4515f3cabcb2e70d71cd4133d069f5286d30654 (diff) | |
| download | emacs-384d1c47cec8e61d1896694b14fcf88710f9dc4d.tar.gz emacs-384d1c47cec8e61d1896694b14fcf88710f9dc4d.zip | |
* test/lisp/minibuffer-tests.el (completion-table-test-quoting): New test
* test/data/minibuffer-test-cttq$tion: New file-name test data.
| -rw-r--r-- | test/data/minibuffer-test-cttq$tion | 0 | ||||
| -rw-r--r-- | test/lisp/minibuffer-tests.el | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/data/minibuffer-test-cttq$tion b/test/data/minibuffer-test-cttq$tion new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/test/data/minibuffer-test-cttq$tion | |||
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 35df7cc17f1..6b297244214 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el | |||
| @@ -80,5 +80,26 @@ | |||
| 80 | (should (equal (try-completion "B-hel" subvtable) | 80 | (should (equal (try-completion "B-hel" subvtable) |
| 81 | "B-hello")))) | 81 | "B-hello")))) |
| 82 | 82 | ||
| 83 | (ert-deftest completion-table-test-quoting () | ||
| 84 | (let ((process-environment | ||
| 85 | `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment))) | ||
| 86 | (pcase-dolist (`(,input ,output) | ||
| 87 | '( | ||
| 88 | ;; Test that $ in files is properly $$ quoted. | ||
| 89 | ("data/m-cttq" "data/minibuffer-test-cttq$$tion") | ||
| 90 | ;; Test that $$ in input is properly unquoted. | ||
| 91 | ("data/m-cttq$$t" "data/minibuffer-test-cttq$$tion") | ||
| 92 | ;; Test that env-vars are preserved. | ||
| 93 | ("lisp/c${CTTQ1}et/se-u" "lisp/c${CTTQ1}et/semantic-utest") | ||
| 94 | ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest") | ||
| 95 | ;; Test that env-vars don't prevent partial-completion. | ||
| 96 | ;; FIXME: Ideally we'd like to keep the ${CTTQ}! | ||
| 97 | ("lis/c${CTTQ1}/se-u" "lisp/cedet/semantic-utest") | ||
| 98 | )) | ||
| 99 | (should (equal (completion-try-completion input | ||
| 100 | #'completion--file-name-table | ||
| 101 | nil (length input)) | ||
| 102 | (cons output (length output))))))) | ||
| 103 | |||
| 83 | (provide 'completion-tests) | 104 | (provide 'completion-tests) |
| 84 | ;;; completion-tests.el ends here | 105 | ;;; completion-tests.el ends here |