summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-23 02:05:28 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-23 02:05:28 +0900
commit601f1fb456c291b5eb4d20e97d8b151bb04ffda2 (patch)
tree5ef1365dc6d9a70bca9e27e4f12f4c31fa30aed6 /tool
parentafab8122c339586ccb120861cc700aa8eee7402c (diff)
Catch syntax error even if fatal
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/test/unit/assertions.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb
index 48ee458b34..e2b865899a 100644
--- a/tool/lib/test/unit/assertions.rb
+++ b/tool/lib/test/unit/assertions.rb
@@ -359,6 +359,8 @@ EOT
code = code.dup.force_encoding(Encoding::UTF_8)
RubyVM::InstructionSequence.compile(code, fname, fname, line)
:ok
+ ensure
+ raise if SyntaxError === $!
end
else
def syntax_check(code, fname, line)