diff --git a/bootstraptest/test_insns.rb b/bootstraptest/test_insns.rb index cb54d0d3f7..abfb53f7dc 100644 --- a/bootstraptest/test_insns.rb +++ b/bootstraptest/test_insns.rb @@ -438,3 +438,8 @@ tests.compact.each {|(insn, expr, *a)| assert_equal 'true', progn, 'trace_' + insn, *a end } + +assert_normal_exit("#{<<-"begin;"}\n#{<<-'end;'}") +begin; + RubyVM::InstructionSequence.compile("", debug_level: 5) +end; diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 02c3967022..960b7b79fc 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -571,4 +571,12 @@ class TestISeq < Test::Unit::TestCase assert_not_nil(invokebuiltin) assert_equal([:func_ptr, :argc, :index, :name], invokebuiltin[1].keys) end + + def test_iseq_option_debug_level + assert_raise(TypeError) {ISeq.compile("", debug_level: "")} + assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + RubyVM::InstructionSequence.compile("", debug_level: 5) + end; + end end