Add test for r38543 [Bug #7597] [ruby-dev:46786]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-12-25 08:00:50 +00:00
parent 59e1e822a1
commit febab308c8

View File

@ -481,7 +481,7 @@ class TestRubyOptions < Test::Unit::TestCase
opts[:rlimit_core] = 0 opts[:rlimit_core] = 0
additional = "" additional = ""
end end
assert_in_out_err(["-e", "Process.kill :SEGV, $$"], "", [], expected_stderr =
%r(\A %r(\A
-e:(?:1:)?\s\[BUG\]\sSegmentation\sfault\n -e:(?:1:)?\s\[BUG\]\sSegmentation\sfault\n
#{ Regexp.quote(RUBY_DESCRIPTION) }\n\n #{ Regexp.quote(RUBY_DESCRIPTION) }\n\n
@ -505,9 +505,8 @@ class TestRubyOptions < Test::Unit::TestCase
\n \n
(?:#{additional}) (?:#{additional})
\z \z
)x, )x
nil, assert_in_out_err(["-e", "Process.kill :SEGV, $$"], "", [], expected_stderr, nil, opts)
opts)
bug7402 = '[ruby-core:49573]' bug7402 = '[ruby-core:49573]'
status = assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end', status = assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end',
@ -517,6 +516,13 @@ class TestRubyOptions < Test::Unit::TestCase
nil, nil,
opts) opts)
assert_not_predicate(status, :success?, "segv but success #{bug7402}") assert_not_predicate(status, :success?, "segv but success #{bug7402}")
bug7597 = '[ruby-dev:46786]'
t = Tempfile.new(["test_ruby_test_bug7597", ".rb"])
t.write "f" * 100
t.flush
assert_in_out_err("-e'$0=$stdin.read; Process.kill :SEGV, $$'", t.path, [], expected_stderr, bug7597)
t.close
end end
def test_DATA def test_DATA