From 605e7d4a603adcdbe1c2bde969c5f95938873ee2 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 4 Sep 2009 23:51:44 +0000 Subject: * re.c (update_char_offset): position should be long. * re.c (match_hash, match_equal): new methods. [ruby-core:24748] * re.c (reg_match_pos, rb_reg_eqq, rb_reg_s_quote): get rid of use VALUE as int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_regexp.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby/test_regexp.rb') diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index a2911801bd..cdbe277ba8 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -778,4 +778,12 @@ class TestRegexp < Test::Unit::TestCase assert_nothing_raised { 0x03ffffff.chr("utf-8").size } assert_nothing_raised { 0x7fffffff.chr("utf-8").size } end + + def test_matchdata + a = "haystack".match(/hay/) + b = "haystack".match(/hay/) + assert_equal(a, b, '[ruby-core:24748]') + h = {a => 42} + assert_equal(42, h[b], '[ruby-core:24748]') + end end -- cgit v1.2.3