mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
2138c773cc
commit
732e40d9b0
3 changed files with 30 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue