summaryrefslogtreecommitdiff
path: root/test/ruby/test_string.rb
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-06 10:01:45 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-06 10:01:45 +0000
commitdd77ae9f6c8d272e08cd4572affaf693e7cb5a1a (patch)
treea4c75c1187abb542e19be68069e8df04268875e5 /test/ruby/test_string.rb
parent9600d9693c4e94e2755001e2e10caedcc761a69c (diff)
* test/ruby/test_string.rb (TestString#test_scan): add a test for
[ruby-core:33338] #4087. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r--test/ruby/test_string.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index e8287622f6..16a6905667 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -968,6 +968,14 @@ class TestString < Test::Unit::TestCase
res = []
a.scan(/(...)/) { |w| res << w }
assert_equal([[S("cru")], [S("el ")], [S("wor")]],res)
+
+ a = S("hello")
+ a.taint
+ a.untrust
+ res = []
+ a.scan(/./) { |w| res << w }
+ assert(res[0].tainted?, '[ruby-core:33338] #4087')
+ assert(res[0].untrusted?, '[ruby-core:33338] #4087')
end
def test_size