summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-04 01:56:19 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-04 01:56:19 +0000
commit0399a3d47b4e784918f95a36c2987633c29f8690 (patch)
tree5d404e745926613a551f3fe39f8c77affd9ab731 /test
parent1745d2584a77306a349fc2209495aa6455763dc5 (diff)
merge revision(s) 52868: [Backport #11767]
* range.c (range_to_s): should be infected by the receiver. str2 infects by appending. [ruby-core:71811] [Bug #11767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@52875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_range.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index 293818516d..6afa0ea565 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -266,11 +266,21 @@ class TestRange < Test::Unit::TestCase
def test_to_s
assert_equal("0..1", (0..1).to_s)
assert_equal("0...1", (0...1).to_s)
+
+ bug11767 = '[ruby-core:71811] [Bug #11767]'
+ assert_predicate(("0".taint.."1").to_s, :tainted?, bug11767)
+ assert_predicate(("0".."1".taint).to_s, :tainted?, bug11767)
+ assert_predicate(("0".."1").taint.to_s, :tainted?, bug11767)
end
def test_inspect
assert_equal("0..1", (0..1).inspect)
assert_equal("0...1", (0...1).inspect)
+
+ bug11767 = '[ruby-core:71811] [Bug #11767]'
+ assert_predicate(("0".taint.."1").inspect, :tainted?, bug11767)
+ assert_predicate(("0".."1".taint).inspect, :tainted?, bug11767)
+ assert_predicate(("0".."1").taint.inspect, :tainted?, bug11767)
end
def test_eqq