aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_argf.rb
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-11 15:56:43 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-11 15:56:43 +0000
commit0a6d09330c9b8b179be1174137e79e4075819275 (patch)
tree58956b2af970bfa3eaea222b046f8d014540ab0c /test/ruby/test_argf.rb
parent78a59b37a161080473ace8d2d14f1fbf6466d025 (diff)
downloadruby-0a6d09330c9b8b179be1174137e79e4075819275.tar.gz
* 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/test_argf.rb')
-rw-r--r--test/ruby/test_argf.rb8
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'