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

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

[nongnu] elpa/bash-completion 6a0ada6278 038/313: completed test cases


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 6a0ada6278 038/313: completed test cases
Date: Sat, 3 Dec 2022 10:59:13 -0500 (EST)

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

    completed test cases
---
 bash-completion.el      |  1 -
 bash-completion_test.el | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/bash-completion.el b/bash-completion.el
index d32a74c1a4..379057e45a 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -95,7 +95,6 @@ Call bash to do the completion."
            "'")))
 
 (defun bash-completion-escape (word)
-  (message "escape: %s" word)
   (if (string-match "^['\"]" word)
       word
     (replace-regexp-in-string "\\([ '\"]\\)" "\\\\\\1" word)))
diff --git a/bash-completion_test.el b/bash-completion_test.el
index 93acddee21..09cb8bada8 100644
--- a/bash-completion_test.el
+++ b/bash-completion_test.el
@@ -400,6 +400,49 @@ garbage
       (bash-completion-fix " world" "hello")
       "hello\\ world")
 
+     ("bash-completion-extract"
+      (flet ((bash-completion-buffer () (current-buffer)))
+       (sz-testutils-with-buffer
+        "hello world\nhello \n\n"
+        (bash-completion-extract "hello")))
+      '("hello\\ world" "hello "))
+
+     ("bash-completion-nonsep"
+      (list
+       (bash-completion-nonsep nil)
+       (bash-completion-nonsep ?')
+       (bash-completion-nonsep ?\"))
+      '("^ \t\n\r'\"" "^ \t\n\r'" "^ \t\n\r\""))
+
+
+     ("bash-completion-escape"
+      (bash-completion-escape "He said: \"hello, 'you'\"")
+      "He\\ said:\\ \\\"hello,\\ \\'you\\'\\\"")
+
+     ("bash-completion-escape not if double quoted"
+      (bash-completion-escape "\"hello, you")
+      "\"hello, you")
+
+     ("bash-completion-escape not if single quoted"
+      (bash-completion-escape "'hello, you")
+      "'hello, you")
+
+     ("bash-completion-quote allowed"
+      (bash-completion-quote "abc_ABC/1-2.3")
+      "abc_ABC/1-2.3")
+
+     ("bash-completion-quote quoted"
+      (bash-completion-quote "a$b")
+      "'a$b'")
+
+     ("bash-completion-quote quoted single quote"
+      (bash-completion-quote "a'b")
+      "'a'\\''b'")
+
+     ("bash-completion-join"
+      (bash-completion-join '("ls" "-l" "/a/b" "/a/b c" "/a/b'c" "$help/d"))
+      "ls -l /a/b '/a/b c' '/a/b'\\''c' '$help/d'")
+
      ))
 
   ;; ---------- integration tests



reply via email to

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