mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_io_m17n.rb (test_textmode_paragraph_nonasciicompat): should
match the modes of both end of pipe as text mode. * test/ruby/test_io_m17n.rb (test_binmode_paragraph_nonasciicompat): new test for binmode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
13f5a607fb
commit
1be8c17f0b
1 changed files with 14 additions and 0 deletions
|
@ -1807,9 +1807,23 @@ EOT
|
|||
end
|
||||
|
||||
def test_textmode_paragraph_nonasciicompat
|
||||
bug3534 = ['[ruby-dev:41803]', '[Bug #3534]']
|
||||
r, w = IO.pipe
|
||||
[Encoding::UTF_32BE, Encoding::UTF_32LE,
|
||||
Encoding::UTF_16BE, Encoding::UTF_16LE,
|
||||
Encoding::UTF_8].each do |e|
|
||||
r.set_encoding(Encoding::US_ASCII, e)
|
||||
w.print(bug3534[0], "\n\n\n\n", bug3534[1], "\n")
|
||||
assert_equal((bug3534[0]+"\n\n").encode(e), r.gets(""), bug3534[0])
|
||||
assert_equal((bug3534[1]+"\n").encode(e), r.gets(), bug3534[1])
|
||||
end
|
||||
end
|
||||
|
||||
def test_binmode_paragraph_nonasciicompat
|
||||
bug3534 = ['[ruby-dev:41803]', '[Bug #3534]']
|
||||
r, w = IO.pipe
|
||||
r.binmode
|
||||
w.binmode
|
||||
[Encoding::UTF_32BE, Encoding::UTF_32LE,
|
||||
Encoding::UTF_16BE, Encoding::UTF_16LE,
|
||||
Encoding::UTF_8].each do |e|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue