1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2017-11-01 03:26:54 +00:00
parent dfbeb7188d
commit bdac4b6ee9

View file

@ -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