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 | 732e40d9b07c786850f60cee022941a24d081f50 (patch) | |
tree | 12fe9165624a7929ab19260f818f26925f85179d /test | |
parent | 2138c773cce15c78ef00b4ed71ba367f11a3bc7f (diff) | |
download | ruby-732e40d9b07c786850f60cee022941a24d081f50.tar.gz |
* string.c (sym_inspect): escape ASCII-compatible strings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@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 |