mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated.
see [ruby-core:43550] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b2cc0976a7
commit
caf627afce
2 changed files with 21 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Mar 22 11:14:10 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated.
|
||||
see [ruby-core:43550]
|
||||
|
||||
Wed Mar 21 17:57:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* regcomp.c: Merge Onigmo 3d855b30d574536d3ae600260208c6624ae4791c.
|
||||
|
|
|
@ -1360,21 +1360,23 @@ class TestIO < Test::Unit::TestCase
|
|||
def test_pos_with_getc
|
||||
bug6179 = '[ruby-core:43497]'
|
||||
t = make_tempfile
|
||||
open(t.path, "w") do |f|
|
||||
f.write "0123456789"
|
||||
end
|
||||
["", "t", "b"].each do |mode|
|
||||
open(t.path, "w#{mode}") do |f|
|
||||
f.write "0123456789\n"
|
||||
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
|
||||
open(t.path, "r#{mode}") do |f|
|
||||
assert_equal 0, f.pos, "mode=r#{mode}"
|
||||
assert_equal '0', f.getc, "mode=r#{mode}"
|
||||
assert_equal 1, f.pos, "mode=r#{mode}"
|
||||
assert_equal '1', f.getc, "mode=r#{mode}"
|
||||
assert_equal 2, f.pos, "mode=r#{mode}"
|
||||
assert_equal '2', f.getc, "mode=r#{mode}"
|
||||
assert_equal 3, f.pos, "mode=r#{mode}"
|
||||
assert_equal '3', f.getc, "mode=r#{mode}"
|
||||
assert_equal 4, f.pos, "mode=r#{mode}"
|
||||
assert_equal '4', f.getc, "mode=r#{mode}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue