ruby-changes:26542
From: naruse <ko1@a...>
Date: Tue, 25 Dec 2012 17:00:58 +0900 (JST)
Subject: [ruby-changes:26542] naruse:r38593 (trunk): Add test for r38543 [Bug #7597]
naruse 2012-12-25 17:00:50 +0900 (Tue, 25 Dec 2012) New Revision: 38593 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38593 Log: Add test for r38543 [Bug #7597] [ruby-dev:46786] Modified files: trunk/test/ruby/test_rubyoptions.rb Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 38592) +++ test/ruby/test_rubyoptions.rb (revision 38593) @@ -481,7 +481,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L481 opts[:rlimit_core] = 0 additional = "" end - assert_in_out_err(["-e", "Process.kill :SEGV, $$"], "", [], + expected_stderr = %r(\A -e:(?:1:)?\s\[BUG\]\sSegmentation\sfault\n #{ Regexp.quote(RUBY_DESCRIPTION) }\n\n @@ -505,9 +505,8 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L505 \n (?:#{additional}) \z - )x, - nil, - opts) + )x + assert_in_out_err(["-e", "Process.kill :SEGV, $$"], "", [], expected_stderr, nil, opts) bug7402 = '[ruby-core:49573]' status = assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end', @@ -517,6 +516,13 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L516 nil, opts) 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 def test_DATA -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/