diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-11 15:56:43 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-11 15:56:43 +0000 |
commit | 0a6d09330c9b8b179be1174137e79e4075819275 (patch) | |
tree | 58956b2af970bfa3eaea222b046f8d014540ab0c /test/ruby | |
parent | 78a59b37a161080473ace8d2d14f1fbf6466d025 (diff) |
* io.c (rb_io_getline_fast, rb_io_getline_1): fix ARGF.lineno behavior. [ruby-core:25205]
* test/ruby/test_argf.rb (TestArgf#test_lineno3): add a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_argf.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index a1f260147e..ffd5096789 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -127,6 +127,14 @@ class TestArgf < Test::Unit::TestCase SRC end + def test_lineno3 + assert_in_out_err(["-", @t1.path, @t2.path], <<-INPUT, %w"1 1 1 2 2 2 3 3 1 4 4 2", [], "[ruby-core:25205]") + ARGF.each do |line| + puts [$., ARGF.lineno, ARGF.file.lineno] + end + INPUT + end + def test_inplace assert_in_out_err(["-", @t1.path, @t2.path, @t3.path], <<-INPUT, [], []) ARGF.inplace_mode = '.bak' |