aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_range.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-03 05:22:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-03 05:22:18 +0000
commitf7fb4e00f721a9d0520b0bbeab687d122f6759ff (patch)
treeb2ef084edd5e79d481ad9903babb480db227c4a2 /test/ruby/test_range.rb
parent1c7f75793d0c82acbc8742a8bfffd7bda5fc6ceb (diff)
downloadruby-f7fb4e00f721a9d0520b0bbeab687d122f6759ff.tar.gz
range.c: infected by the receiver
* 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/trunk@52868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_range.rb')
-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 eaffac817c..a91f80b076 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -283,11 +283,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