ruby-changes:48487
From: nobu <ko1@a...>
Date: Wed, 1 Nov 2017 12:26:56 +0900 (JST)
Subject: [ruby-changes:48487] nobu:r60601 (trunk): test_syntax.rb: all assertions
nobu 2017-11-01 12:26:54 +0900 (Wed, 01 Nov 2017) New Revision: 60601 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60601 Log: test_syntax.rb: all assertions * test/ruby/test_syntax.rb (test_return_toplevel): try all assertions even if any assertions failed. Modified files: trunk/test/ruby/test_syntax.rb Index: test/ruby/test_syntax.rb =================================================================== --- test/ruby/test_syntax.rb (revision 60600) +++ test/ruby/test_syntax.rb (revision 60601) @@ -1011,15 +1011,16 @@ eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L1011 failed = proc do |n, s| RubyVM::InstructionSequence.compile(s, __FILE__, nil, n).disasm end - all_assertions_foreach(feature4840, *code) do |n, s, *ex| - assert_in_out_err(%[-W0], src = s, ex, [], proc {failed[n, s]}, success: true) - end Tempfile.create(%w"test_return_ .rb") do |lib| lib.close args = %W[-W0 -r#{lib.path}] - all_assertions_foreach(feature4840, *code) do |n, s, *ex| - File.write(lib, s) - assert_in_out_err(args, "", ex, [], proc {failed[n, s]}, success: true) + all_assertions_foreach(feature4840, *[true, false].product(code)) do |main, (n, s, *ex)| + if main + assert_in_out_err(%[-W0], s, ex, [], proc {failed[n, s]}, success: true) + else + File.write(lib, s) + assert_in_out_err(args, "", ex, [], proc {failed[n, s]}, success: true) + end end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/