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
This commit is contained in:
nobu 2014-03-27 09:08:54 +00:00
parent 2dc8f669a8
commit ffdb3ce9b9
2 changed files with 6 additions and 3 deletions

View file

@ -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