diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-01 03:26:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-01 03:26:54 +0000 |
commit | bdac4b6ee95d4a4e1458c5c3d41e631a81062ffd (patch) | |
tree | f4b4d490607e1c95aae19a2a73265cddab121a9f | |
parent | dfbeb7188d947bc0f523a75a5e4012e56aaece25 (diff) | |
download | ruby-bdac4b6ee95d4a4e1458c5c3d41e631a81062ffd.tar.gz |
test_syntax.rb: all assertions
* test/ruby/test_syntax.rb (test_return_toplevel): try all
assertions even if any assertions failed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_syntax.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 0a0ef83f8b..2014e289d3 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1011,15 +1011,16 @@ eom 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 |