diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-30 12:39:28 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-30 12:39:28 +0900 |
commit | 3805ef7fb57136be46fceb693340981c75eb8ec1 (patch) | |
tree | 7fd7f761a0c939f4d7d852ba35da5096bffb6b3f /test/ruby | |
parent | 1da3a31a5f0211db121e0df4ca456838a437537f (diff) | |
download | ruby-3805ef7fb57136be46fceb693340981c75eb8ec1.tar.gz |
Separate test_set_lineno_gets
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 0c81f4cb82..49da709199 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -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" |