summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-06-20 13:19:48 -0700
committerJeremy Evans <code@jeremyevans.net>2019-09-27 07:43:32 -0700
commit43a16c98df392e726040f0331a3e09d00c53d513 (patch)
tree1ee0c11ecc50da5c9e14597838ce035341a895b7 /test
parent2b6a9f3a1ffcdb00bf89798979d475c6d189d419 (diff)
Do not escape + in Shellwords.escape
+ is not a character that requires escaping in Bourne sh. Fixes [Bug #14429]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2494
Diffstat (limited to 'test')
-rw-r--r--test/test_shellwords.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_shellwords.rb b/test/test_shellwords.rb
index 16949c02d3..86971b7237 100644
--- a/test/test_shellwords.rb
+++ b/test/test_shellwords.rb
@@ -68,6 +68,11 @@ class TestShellwords < Test::Unit::TestCase
assert_equal "ps -p #{$$}", joined
end
+ def test_shellescape
+ assert_equal "''", shellescape('')
+ assert_equal "\\^AZaz09_\\\\-.,:/@'\n'+\\'\\\"", shellescape("^AZaz09_\\-.,:\/@\n+'\"")
+ end
+
def test_whitespace
empty = ''
space = " "