diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-25 18:44:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-25 18:44:16 +0000 |
commit | d0ac6d5879c8d2132a7419ff2b8a4fb3b3a28597 (patch) | |
tree | 1acb43fac496323b967ae97c47b11a71e09b1926 /test/ruby/test_object.rb | |
parent | f2fc80cebeafdb0c8e354b31825f192c7d40825e (diff) | |
download | ruby-d0ac6d5879c8d2132a7419ff2b8a4fb3b3a28597.tar.gz |
object.c: preserve encodings
* object.c (inspect_i): preserve encodings in inspected result
string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r-- | test/ruby/test_object.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 0fe9471fa6..94a6e9d201 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -758,10 +758,12 @@ class TestObject < Test::Unit::TestCase def initialize @\u{3044} = 42 end - new.inspect + new end EOS - assert_match(/\bInspect\u{3042}:.* @\u{3044}=42\b/, x) + assert_match(/\bInspect\u{3042}:.* @\u{3044}=42\b/, x.inspect) + x.instance_variable_set("@\u{3046}".encode(Encoding::EUC_JP), 6) + assert_match(/@\u{3046}=6\b/, x.inspect) end def test_singleton_class |