summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-07 14:43:10 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-07 14:43:10 +0000
commit69cc900f523dff669a788d57e9599cb43263a9f5 (patch)
tree242da261fa0bf782c318e954ea0dac8281e331ae /test
parentf37162c06f180627dc91cdac1be14664b66a0962 (diff)
merge revision(s) 33171:
* 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/branches/ruby_1_9_3@33211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 0e709a204d..a033a74d32 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -648,12 +648,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