mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
54c0e4b76e
commit
48eb4a7923
1 changed files with 15 additions and 8 deletions
|
@ -1774,15 +1774,22 @@ EOT
|
|||
}
|
||||
end
|
||||
|
||||
|
||||
def test_cbuf_select
|
||||
with_tmpdir {
|
||||
r, w = IO.pipe
|
||||
w << "\r\n"
|
||||
r.set_encoding("US-ASCII:UTF-8", :universal_newline => true)
|
||||
r.ungetc(r.getc)
|
||||
assert_equal([[r],[],[]], IO.select([r], nil, nil, 1))
|
||||
}
|
||||
r, w = IO.pipe
|
||||
w << "\r\n"
|
||||
r.set_encoding("US-ASCII:UTF-8", :universal_newline => true)
|
||||
r.ungetc(r.getc)
|
||||
assert_equal([[r],[],[]], IO.select([r], nil, nil, 1))
|
||||
end
|
||||
|
||||
def test_textmode_paragraphmode
|
||||
r, w = IO.pipe
|
||||
w << "a\n\n\nc".gsub(/\n/, "\r\n")
|
||||
w.close
|
||||
r.set_encoding("US-ASCII:UTF-8", :universal_newline => true)
|
||||
assert_equal("a\n\n", r.gets(""))
|
||||
assert_equal("c", r.gets(""), "[ruby-core:23723] (18)")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue