diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-27 09:08:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-27 09:08:54 +0000 |
commit | ffdb3ce9b9ca8696d04fd7319ee5f77b532b1f0b (patch) | |
tree | 8b38d2813011a177e515f3b95237894853908ec5 /test | |
parent | 2dc8f669a8874d89e719b7d96b7249fa92c27c11 (diff) |
re.c: class name encoding
* re.c (match_inspect): preserve class name encoding by PRIsVALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_regexp.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index cff2bb6d1f..de8ecdba22 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -887,12 +887,15 @@ class TestRegexp < Test::Unit::TestCase assert_no_match(/^\p{age=1.1}$/u, "\u2754") end + MatchData_A = eval("class MatchData_\u{3042} < MatchData; self; 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]') + assert_match(/#<TestRegexp::MatchData_\u{3042}:/, MatchData_A.allocate.inspect) end def test_regexp_poped |