branch: externals/shell-command+
commit 86caf3dc34c977a1feec7f82770a2de00e33c0ee
Author: Philip K <phil...@posteo.net>
Commit: Philip K <phil...@posteo.net>

    Add tests for shell-command+-tokenize
---
 shell-command+-tests.el | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/shell-command+-tests.el b/shell-command+-tests.el
index e4c54e2..b68169d 100644
--- a/shell-command+-tests.el
+++ b/shell-command+-tests.el
@@ -154,5 +154,26 @@
       (should (string= (shell-command+-expand-path path)
                        expand)))))
 
+(ert-deftest sc+-tokenize ()
+  "Test that `shell-command+-tokenize' works as expected"
+  (pcase-dolist (`(,args ,expand ,list)
+                 '(("a b c" nil ("a" "b" "c"))
+                   ("a \"b c\" d" nil ("a" "b c" "d"))
+                   ("a *.el d" nil ("a" "*.el" "d"))
+                   ("a *.el d" t ("a"
+                                  ".dir-locals.el"
+                                  "shell-command+-tests.el"
+                                  "shell-command+.el"
+                                  "d"))
+                   ("a b *.el" nil ("a" "b" "*.el"))
+                   ("a b *.el" t ("a" "b"
+                                  ".dir-locals.el"
+                                  "shell-command+-tests.el"
+                                  "shell-command+.el"))
+                   ("a \"*.el\" d" nil ("a" "*.el" "d"))
+                   ("a \"*.el\" d" t ("a" "*.el" "d"))))
+    (should (equal (shell-command+-tokenize args expand)
+                   list))))
+
 (provide 'shell-command+-tests)
 ;;; shell-command+-tests.el ends here

Reply via email to