summaryrefslogtreecommitdiff
path: root/test/ruby/test_argf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-03 14:52:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-03 14:52:18 +0000
commit74f724de1acf9773a4220dedb544b80d4a7311a5 (patch)
tree779c21531dc11ac44ba37f2ebfdae352fcd0b157 /test/ruby/test_argf.rb
parenta46d29bb4e232064b68f54e46be8a44216570563 (diff)
* io.c (argf_next_argv): open in default text mode.
[ruby-core:39234] [Bug #5268] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r--test/ruby/test_argf.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index e249c757ea8..a588e07fcb5 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -641,12 +641,23 @@ class TestArgf < Test::Unit::TestCase
end
def test_binmode
+ bug5268 = '[ruby-core:39234]'
+ open(@t3.path, "wb") {|f| f.write "5\r\n6\r\n"}
ruby('-e', "ARGF.binmode; STDOUT.binmode; puts ARGF.read", @t1.path, @t2.path, @t3.path) do |f|
f.binmode
- assert_equal("1\n2\n3\n4\n5\n6\n", f.read)
+ assert_equal("1\n2\n3\n4\n5\r\n6\r\n", f.read, bug5268)
end
end
+ def test_textmode
+ bug5268 = '[ruby-core:39234]'
+ open(@t3.path, "wb") {|f| f.write "5\r\n6\r\n"}
+ ruby('-e', "STDOUT.binmode; puts ARGF.read", @t1.path, @t2.path, @t3.path) do |f|
+ f.binmode
+ assert_equal("1\n2\n3\n4\n5\n6\n", f.read, bug5268)
+ end
+ end unless IO::BINARY.zero?
+
def test_skip
ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
ARGF.skip