summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-10 18:19:57 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-10 18:19:57 +0000
commit45501becfbae97316409d9d1d4d8115936b0a365 (patch)
treec03eb3ecf3caa9251523833c81f70ffb54fb1610
parent3d3cf9705b7355214089dc51a1b9a6cfbfc9a7c0 (diff)
merge revision(s) 33152,33649:
* test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish, default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test committed in r33144. I'd misunderstood the spec of ruby's universal newline. * test/ruby/test_io_m17n.rb (TestIO_M17N#test_default_stdout_stderr_mode): new test for r33627-33629. see [backport #5565] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog13
-rw-r--r--test/ruby/test_io_m17n.rb32
-rw-r--r--version.h2
3 files changed, 40 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 57008df041..467b15e196 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Sat Feb 11 03:19:45 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_default_stdout_stderr_mode): new test for
+ r33627-33629. see [backport #5565]
+
+Sat Feb 11 03:19:45 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
+ default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test
+ committed in r33144. I'd misunderstood the spec of ruby's universal
+ newline.
+
Sat Feb 11 03:17:41 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 01dca47f7f..ecf34c793f 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -2072,29 +2072,49 @@ EOT
def test_default_mode_on_dosish
with_tmpdir {
- open("a", "w") {|f| f.puts}
+ open("a", "w") {|f| f.write "\n"}
assert_equal("\r\n", IO.binread("a"))
}
end if /mswin|mingw/ =~ RUBY_PLATFORM
def test_default_mode_on_unix
with_tmpdir {
- open("a", "w") {|f| f.puts}
+ open("a", "w") {|f| f.write "\n"}
assert_equal("\n", IO.binread("a"))
}
end unless /mswin|mingw/ =~ RUBY_PLATFORM
def test_text_mode
with_tmpdir {
- open("a", "wt") {|f| f.puts}
- assert_equal("\r\n", IO.binread("a"))
+ open("a", "wb") {|f| f.write "\r\n"}
+ assert_equal("\n", open("a", "rt"){|f| f.read})
}
end
def test_binary_mode
with_tmpdir {
- open("a", "wb") {|f| f.puts}
- assert_equal("\n", IO.binread("a"))
+ open("a", "wb") {|f| f.write "\r\n"}
+ assert_equal("\r\n", open("a", "rb"){|f| f.read})
}
end
+
+ def test_default_stdout_stderr_mode
+ with_pipe do |in_r, in_w|
+ with_pipe do |out_r, out_w|
+ pid = Process.spawn({}, EnvUtil.rubybin, in: in_r, out: out_w, err: out_w)
+ in_r.close
+ out_w.close
+ in_w.write <<-EOS
+ STDOUT.puts "abc"
+ STDOUT.flush
+ STDERR.puts "def"
+ STDERR.flush
+ EOS
+ in_w.close
+ Process.wait pid
+ assert_equal "abc\r\ndef\r\n", out_r.binmode.read
+ out_r.close
+ end
+ end
+ end if /mswin|mingw/ =~ RUBY_PLATFORM
end
diff --git a/version.h b/version.h
index 9b97f48ae8..f5f0fc8b57 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 86
+#define RUBY_PATCHLEVEL 87
#define RUBY_RELEASE_DATE "2012-02-11"
#define RUBY_RELEASE_YEAR 2012