summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-21 08:03:08 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-21 08:03:08 +0000
commitaf86dba25a9b2c580fc10a8fe169f41c8385a22d (patch)
tree967a27f7d6e4c13c21642c202ebc3317998e5750 /test
parent905eb21dcad8c935fb6fa21362eda9163c26ec85 (diff)
* test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
see [Bug #6179][ruby-core:43518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index b08e0753bf..a3ac12765c 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1357,6 +1357,28 @@ class TestIO < Test::Unit::TestCase
end
end
+ def test_pos_with_getc
+ bug6179 = '[ruby-core:43497]'
+ t = make_tempfile
+ open(t.path, "w") do |f|
+ f.write "0123456789"
+ end
+
+ open(t.path, "r") do |f|
+ assert_equal 0, f.pos
+ assert_equal '0', f.getc
+ assert_equal 1, f.pos
+ assert_equal '1', f.getc
+ assert_equal 2, f.pos
+ assert_equal '2', f.getc
+ assert_equal 3, f.pos
+ assert_equal '3', f.getc
+ assert_equal 4, f.pos
+ assert_equal '4', f.getc
+ end
+ end
+
+
def test_sysseek
t = make_tempfile