diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-28 09:37:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-28 09:37:06 +0000 |
commit | 2138c773cce15c78ef00b4ed71ba367f11a3bc7f (patch) | |
tree | 14c8e8d46b91e7986aeace3610f91198f479cf89 /test/ruby/test_string.rb | |
parent | 11cef3cca3cf1a068fa2df166ffdfb7d604bc794 (diff) | |
download | ruby-2138c773cce15c78ef00b4ed71ba367f11a3bc7f.tar.gz |
* string.c (rb_str_inspect): escape ASCII-compatible strings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index eef242bc7c..2674df4243 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1874,4 +1874,11 @@ class TestString < Test::Unit::TestCase assert_equal(s, k, '[ruby-dev:39068]') assert_equal(Encoding::UTF_8, k.encoding, '[ruby-dev:39068]') end + + def test_ascii_incomat_inspect + [Encoding::UTF_16LE, Encoding::UTF_16BE, + Encoding::UTF_32LE, Encoding::UTF_32BE].each do |e| + assert_equal('"\\u0061\\u0062\\u0063"', "abc".encode(e).inspect) + end + end end |