summaryrefslogtreecommitdiffstats
path: root/test/ruby
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
commit8cca70725e9fbdebba93e1787bd04cab469106fb (patch)
tree832d0fad8b0c7d5c4486307fa0c703e70ac512e9 /test/ruby
parent661e557cdfe36546cfaa62cc7c1eb41f2f14cfa0 (diff)
downloadruby-8cca70725e9fbdebba93e1787bd04cab469106fb.tar.gz
ruby-8cca70725e9fbdebba93e1787bd04cab469106fb.tar.xz
ruby-8cca70725e9fbdebba93e1787bd04cab469106fb.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@24754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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 a2911801b..cdbe277ba 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