From c9fac6977bcea6d18a3d2e5abfb25dc29164c558 Mon Sep 17 00:00:00 2001 From: knu Date: Sun, 12 Feb 2012 07:51:05 +0000 Subject: merge revision(s) 34284:34286: * lib/shellwords.rb: Fix rdoc markups. * lib/shellwords.rb (Shellwords#shellsplit): Fix a bug where consecutive backslashes in double quotes are all removed except the one at the tail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/test_shellwords.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') 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 -- cgit v1.2.3