From 44d0c5ae3f1e1586f9dac07dd19f65b80fb8e2b4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 11 Jan 2024 13:51:32 -0500 Subject: [PRISM] Raise syntax errors when found --- test/ruby/test_iseq.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index b0896511d8..f5c0b82057 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -801,12 +801,15 @@ class TestISeq < Test::Unit::TestCase def test_compile_prism_with_file Tempfile.create(%w"test_iseq .rb") do |f| - f.puts "name = 'Prism'; puts 'hello" + f.puts "name = 'Prism'; puts 'hello'" f.close - assert_nothing_raised(SyntaxError) { - RubyVM::InstructionSequence.compile_prism(f.path) - } + assert_nothing_raised(TypeError) do + begin + RubyVM::InstructionSequence.compile_prism(f.path) + rescue SyntaxError + end + end end end end -- cgit v1.2.3