зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
905eb21dca
Коммит
af86dba25a
|
@ -1,3 +1,8 @@
|
|||
Wed Mar 21 17:01:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
|
||||
see [Bug #6179][ruby-core:43518]
|
||||
|
||||
Mon Mar 19 17:18:51 2012 Shugo Maeda <shugo@ruby-lang.org>
|
||||
|
||||
* enumerator.c (lazy_flat_map_func): convert the block value to
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче