mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 23:45:55 +02:00
* string.c (rb_str_inspect): fix: extra back slash is added when
the string is dummy encoding and includes \x22 or \x5C. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c19f9a508f
commit
2b79366f52
3 changed files with 13 additions and 2 deletions
|
@ -1917,6 +1917,11 @@ class TestString < Test::Unit::TestCase
|
|||
assert_equal('"abc\\"\\\\"', i, bug4081)
|
||||
end
|
||||
|
||||
def test_dummy_inspect
|
||||
assert_equal('"\e\x24\x42\x22\x4C\x22\x68\e\x28\x42"',
|
||||
"\u{ffe2}\u{2235}".encode("cp50220").inspect)
|
||||
end
|
||||
|
||||
def test_prepend
|
||||
assert_equal(S("hello world!"), "world!".prepend("hello "))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue