mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix test when default_external is US-ASCII.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
41d8e49dc5
commit
8a73c0ec5f
1 changed files with 2 additions and 1 deletions
|
@ -757,11 +757,12 @@ class TestM17N < Test::Unit::TestCase
|
|||
|
||||
def test_sprintf_p
|
||||
enc = "".inspect.encoding
|
||||
asc = Encoding::US_ASCII
|
||||
Encoding.list.each do |e|
|
||||
format = "%p".force_encoding(e)
|
||||
['', 'a', "\xC2\xA1", "\x00"].each do |s|
|
||||
s.force_encoding(e)
|
||||
assert_strenc(s.inspect, enc, format % s)
|
||||
assert_strenc(s.inspect, e.ascii_compatible? && enc == asc ? e : enc, format % s)
|
||||
end
|
||||
s = "\xC2\xA1".force_encoding(e)
|
||||
assert_strenc('%10s' % s.inspect, enc, "%10p" % s)
|
||||
|
|
Loading…
Reference in a new issue