From d8a1986a05110b2468a256ab94936ef482f010bb Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 27 Mar 2017 16:41:00 +0000 Subject: merge revision(s) 57374: [Backport #13135] string.c: rindex(//) should set $~. This seems a bug introduced by r520 (1.4.0). [ruby-core:79110] [Bug #13135] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby/test_string.rb') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index bf7a2d0f9b..2a19b055be 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1110,6 +1110,9 @@ class TestString < Test::Unit::TestCase assert_nil("foo".rindex(//, -100)) assert_nil($~) + + assert_equal(3, "foo".rindex(//)) + assert_equal([3, 3], $~.offset(0)) end def test_rjust -- cgit v1.2.3