diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-09 12:30:12 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-09 12:30:12 +0000 |
commit | 12474f034730c2832e5785a2b2e3eeaaa181d743 (patch) | |
tree | a1689cf1b4e47931c907b11ed0f4b114325208b1 /test | |
parent | ecc889b1c8a9175c82f97749b87e3c06357e3cb6 (diff) |
* test/ruby/test_process.rb (test_rlimit_{name,value}): test in UTF-8
encoding. fix test failures introduced at r59531 on some platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 9fb5665082..f46deb8720 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -121,15 +121,19 @@ class TestProcess < Test::Unit::TestCase } assert_raise(ArgumentError) { Process.getrlimit(:FOO) } assert_raise(ArgumentError) { Process.getrlimit("FOO") } - assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) { Process.getrlimit("\u{30eb 30d3 30fc}") } + EnvUtil.with_default_internal(Encoding::UTF_8) do + assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) { Process.getrlimit("\u{30eb 30d3 30fc}") } + end end def test_rlimit_value return unless rlimit_exist? assert_raise(ArgumentError) { Process.setrlimit(:FOO, 0) } assert_raise(ArgumentError) { Process.setrlimit(:CORE, :FOO) } - assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) { Process.setrlimit("\u{30eb 30d3 30fc}", 0) } - assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) { Process.setrlimit(:CORE, "\u{30eb 30d3 30fc}") } + EnvUtil.with_default_internal(Encoding::UTF_8) do + assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) { Process.setrlimit("\u{30eb 30d3 30fc}", 0) } + assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) { Process.setrlimit(:CORE, "\u{30eb 30d3 30fc}") } + end with_tmpchdir do s = run_in_child(<<-'End') cur, max = Process.getrlimit(:NOFILE) |