aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-01 03:26:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-01 03:26:54 +0000
commitb590ecb45a8eaa431a072bfcb07b5416c3d4878b (patch)
treef4b4d490607e1c95aae19a2a73265cddab121a9f /test
parenta739ba8258f17ab93f0653be1e1333a37fcdc3c0 (diff)
downloadruby-b590ecb45a8eaa431a072bfcb07b5416c3d4878b.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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb13
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