[前][次][番号順一覧][スレッド一覧]

ruby-changes:67111

From: Nobuyoshi <ko1@a...>
Date: Wed, 11 Aug 2021 10:54:55 +0900 (JST)
Subject: [ruby-changes:67111] 7de7e9fdb7 (master): Assert that each contents are read [Bug #18074]

https://git.ruby-lang.org/ruby.git/commit/?id=7de7e9fdb7

From 7de7e9fdb7ef78c3fbd62d1b34ae1e4ee89cf7a9 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 10 Aug 2021 22:06:05 +0900
Subject: Assert that each contents are read [Bug #18074]

---
 test/ruby/test_argf.rb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index 76a2720..3c9b1c6 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -1112,11 +1112,14 @@ class TestArgf < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_argf.rb#L1112
   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
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]