summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2021-08-10 22:06:05 +0900
committerNobuyoshi Nakada <[email protected]>2021-08-10 23:40:45 +0900
commit7de7e9fdb7ef78c3fbd62d1b34ae1e4ee89cf7a9 (patch)
tree31424690971d1edafbeaea4d8707228b3fdaf2f3
parent28d03ee776af4d630556fcaad7305340cbcf9cde (diff)
Assert that each contents are read [Bug #18074]
-rw-r--r--test/ruby/test_argf.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index 76a2720d47..3c9b1c63fc 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -1112,11 +1112,14 @@ class TestArgf < Test::Unit::TestCase
end
def test_sized_read
+ s = "a"
[@t1, @t2, @t3].each { |t|
- open(t.path, "wb") { |f| f.write "t" }
+ File.binwrite(t.path, s)
+ s = s.succ
}
- ruby('-e', "print ARGF.read(3).size", @t1.path, @t2.path, @t3.path) do |f|
- assert_equal("3", f.read)
+
+ ruby('-e', "print ARGF.read(3)", @t1.path, @t2.path, @t3.path) do |f|
+ assert_equal("abc", f.read)
end
end
end