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

Added test for debug_level: option of RubyVM::InstructionSequence.compile

This commit is contained in:
Nobuyoshi Nakada 2020-04-15 14:27:38 +09:00
parent 1dad9fa5e1
commit a9567cc2bf
Notes: git 2020-04-15 16:07:13 +09:00
2 changed files with 13 additions and 0 deletions

View file

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

View file

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