diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-28 09:39:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-28 09:39:41 +0000 |
commit | 5f3f080504a4e35eb5c963cc5af326aaf122e834 (patch) | |
tree | 9193995c8eaa80879d3cb7ce92a3718342ad4158 /test | |
parent | 2dfa488b2a7e2f9a859082298fce4e10b426635d (diff) |
* string.c (sym_inspect): escape ASCII-compatible strings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_symbol.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 0f09669293..07716821f4 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -136,4 +136,11 @@ class TestSymbol < Test::Unit::TestCase def test_symbol_poped assert_nothing_raised { eval('a = 1; :"#{ a }"; 1') } 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).to_sym.inspect) + end + end end |