mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_argf.rb (test_binmode): wrong test. fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
235df50648
commit
a966b61fd2
1 changed files with 8 additions and 3 deletions
|
@ -203,7 +203,7 @@ class TestArgf < Test::Unit::TestCase
|
|||
w.puts " puts line.chomp + '.new'"
|
||||
w.puts "end"
|
||||
w.close
|
||||
assert_match(/Can't rename .* to .*: .*. skipping file/, e.read)
|
||||
assert_match(/Can't rename .* to .*: .*. skipping file/, e.read) #'
|
||||
assert_equal("", r.read)
|
||||
assert_equal("foo\nbar\nbaz\n", File.read(t.path))
|
||||
end
|
||||
|
@ -642,8 +642,13 @@ class TestArgf < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_binmode
|
||||
ruby('-e', "ARGF.binmode; puts ARGF.read", @t1.path, @t2.path, @t3.path) do |f|
|
||||
assert_equal("1\n2\n3\n4\n5\n6\n", f.read)
|
||||
r = ""
|
||||
@tmps.each do |f|
|
||||
r << IO.read(f.path, mode:"rb")
|
||||
end
|
||||
ruby('-e', "ARGF.binmode; STDOUT.binmode; puts ARGF.read", @t1.path, @t2.path, @t3.path) do |f|
|
||||
f.binmode
|
||||
assert_equal(r, f.read)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue