diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-06 11:18:58 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-06 11:18:58 +0000 |
commit | 1be8c17f0b843d569f463430c8513d38dbccd194 (patch) | |
tree | 5fc9c7e5ec56711a1af537afce13c5f7a4514592 | |
parent | 13f5a607fb3e1269b079bb7a262addd7e718791b (diff) | |
download | ruby-1be8c17f0b843d569f463430c8513d38dbccd194.tar.gz |
* 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
-rw-r--r-- | test/ruby/test_io_m17n.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index d9bdc1c2d9..21b7941cbe 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -1809,7 +1809,21 @@ EOT 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| |