diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-04 23:51:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-04 23:51:44 +0000 |
commit | 605e7d4a603adcdbe1c2bde969c5f95938873ee2 (patch) | |
tree | 832d0fad8b0c7d5c4486307fa0c703e70ac512e9 /test/ruby/test_regexp.rb | |
parent | 7633eb4c51fd088ad1f85109929b0a93c4d7e3fb (diff) |
* 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
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r-- | test/ruby/test_regexp.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |