emacs-diffs
[Top][All Lists]
Advanced

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

master 384d1c4: * test/lisp/minibuffer-tests.el (completion-table-test-q


From: Stefan Monnier
Subject: master 384d1c4: * test/lisp/minibuffer-tests.el (completion-table-test-quoting): New test
Date: Tue, 26 Nov 2019 13:18:23 -0500 (EST)

branch: master
commit 384d1c47cec8e61d1896694b14fcf88710f9dc4d
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * test/lisp/minibuffer-tests.el (completion-table-test-quoting): New test
    
    * test/data/minibuffer-test-cttq$tion: New file-name test data.
---
 test/data/minibuffer-test-cttq$tion |  0
 test/lisp/minibuffer-tests.el       | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/test/data/minibuffer-test-cttq$tion 
b/test/data/minibuffer-test-cttq$tion
new file mode 100644
index 0000000..e69de29
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 35df7cc..6b29724 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -80,5 +80,26 @@
     (should (equal (try-completion "B-hel" subvtable)
                    "B-hello"))))
 
+(ert-deftest completion-table-test-quoting ()
+  (let ((process-environment
+         `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment)))
+    (pcase-dolist (`(,input ,output)
+                   '(
+                     ;; Test that $ in files is properly $$ quoted.
+                     ("data/m-cttq" "data/minibuffer-test-cttq$$tion")
+                     ;; Test that $$ in input is properly unquoted.
+                     ("data/m-cttq$$t" "data/minibuffer-test-cttq$$tion")
+                     ;; Test that env-vars are preserved.
+                     ("lisp/c${CTTQ1}et/se-u" 
"lisp/c${CTTQ1}et/semantic-utest")
+                     ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest")
+                     ;; Test that env-vars don't prevent partial-completion.
+                     ;; FIXME: Ideally we'd like to keep the ${CTTQ}!
+                     ("lis/c${CTTQ1}/se-u" "lisp/cedet/semantic-utest")
+                     ))
+      (should (equal (completion-try-completion input
+                                                #'completion--file-name-table
+                                                nil (length input))
+                     (cons output (length output)))))))
+
 (provide 'completion-tests)
 ;;; completion-tests.el ends here



reply via email to

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