summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-04 23:51:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-04 23:51:44 +0000
commit605e7d4a603adcdbe1c2bde969c5f95938873ee2 (patch)
tree832d0fad8b0c7d5c4486307fa0c703e70ac512e9 /test
parent7633eb4c51fd088ad1f85109929b0a93c4d7e3fb (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')
-rw-r--r--test/ruby/test_regexp.rb8
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