1
0
Fork 0
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:
naruse 2010-01-16 16:53:17 +00:00
parent 41d8e49dc5
commit 8a73c0ec5f

View file

@ -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)