summaryrefslogtreecommitdiff
path: root/test/lisp/shell-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/shell-tests.el')
-rw-r--r--test/lisp/shell-tests.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el
index d918de771b7..223a18590b1 100644
--- a/test/lisp/shell-tests.el
+++ b/test/lisp/shell-tests.el
@@ -45,4 +45,23 @@
(should (equal (shell--parse-pcomplete-arguments)
'(("cd" "ba" "") 1 4 7)))))
+(ert-deftest shell-tests-split-string ()
+ (should (equal (split-string-shell-command "ls /tmp")
+ '("ls" "/tmp")))
+ (should (equal (split-string-shell-command "ls '/tmp/foo bar'")
+ '("ls" "/tmp/foo bar")))
+ (should (equal (split-string-shell-command "ls \"/tmp/foo bar\"")
+ '("ls" "/tmp/foo bar")))
+ (should (equal (split-string-shell-command "ls /tmp/'foo bar'")
+ '("ls" "/tmp/foo bar")))
+ (should (equal (split-string-shell-command "ls /tmp/'foo\"bar'")
+ '("ls" "/tmp/foo\"bar")))
+ (should (equal (split-string-shell-command "ls /tmp/\"foo''bar\"")
+ '("ls" "/tmp/foo''bar")))
+ (should (equal (split-string-shell-command "ls /tmp/'foo\\ bar'")
+ '("ls" "/tmp/foo\\ bar")))
+ (unless (memq system-type '(windows-nt ms-dos))
+ (should (equal (split-string-shell-command "ls /tmp/foo\\ bar")
+ '("ls" "/tmp/foo bar")))))
+
;;; shell-tests.el ends here