aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_string.rb
diff options
context:
space:
mode:
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 5c8c4184a0..62402353a7 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1147,6 +1147,14 @@ class TestString < Test::Unit::TestCase
res = []
a.scan(/./) { |w| res << w }
assert_predicate(res[0], :tainted?, '[ruby-core:33338] #4087')
+
+ /h/ =~ a
+ a.scan(/x/)
+ assert_nil($~)
+
+ /h/ =~ a
+ a.scan('x')
+ assert_nil($~)
end
def test_size