1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Separate test_set_lineno_gets

This commit is contained in:
Nobuyoshi Nakada 2019-07-30 12:39:28 +09:00
parent 1da3a31a5f
commit 3805ef7fb5
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -1717,23 +1717,25 @@ class TestIO < Test::Unit::TestCase
f.gets; assert_equal(3, $.)
end
SRC
pipe(proc do |w|
w.puts "foo"
w.puts "bar"
w.puts "baz"
w.close
end, proc do |r|
r.gets; assert_equal(1, $.)
r.gets; assert_equal(2, $.)
r.lineno = 1000; assert_equal(2, $.)
r.gets; assert_equal(1001, $.)
r.gets; assert_equal(1001, $.)
end)
}
end
def test_readline
def test_set_lineno_gets
pipe(proc do |w|
w.puts "foo"
w.puts "bar"
w.puts "baz"
w.close
end, proc do |r|
r.gets; assert_equal(1, $.)
r.gets; assert_equal(2, $.)
r.lineno = 1000; assert_equal(2, $.)
r.gets; assert_equal(1001, $.)
r.gets; assert_equal(1001, $.)
end)
end
def test_set_lineno_readline
pipe(proc do |w|
w.puts "foo"
w.puts "bar"