summaryrefslogtreecommitdiff
path: root/test/test_shellwords.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_shellwords.rb')
-rw-r--r--test/test_shellwords.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_shellwords.rb b/test/test_shellwords.rb
index 593f0e0aea..bd44aec1af 100644
--- a/test/test_shellwords.rb
+++ b/test/test_shellwords.rb
@@ -38,6 +38,15 @@ class TestShellwords < Test::Unit::TestCase
end
end
+ def test_backslashes
+ cmdline, expected = [
+ %q{/a//b///c////d/////e/ "/a//b///c////d/////e/ "'/a//b///c////d/////e/ '/a//b///c////d/////e/ },
+ %q{a/b/c//d//e a/b/c//d//e /a//b///c////d/////e/ a/b/c//d//e }
+ ].map { |str| str.tr("/", "\\\\") }
+
+ assert_equal [expected], shellwords(cmdline)
+ end
+
def test_multibyte_characters
# This is not a spec. It describes the current behavior which may
# be changed in future. There would be no multibyte character