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:
parent
1dad9fa5e1
commit
a9567cc2bf
Notes:
git
2020-04-15 16:07:13 +09:00
2 changed files with 13 additions and 0 deletions
|
@ -438,3 +438,8 @@ tests.compact.each {|(insn, expr, *a)|
|
||||||
assert_equal 'true', progn, 'trace_' + insn, *a
|
assert_equal 'true', progn, 'trace_' + insn, *a
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert_normal_exit("#{<<-"begin;"}\n#{<<-'end;'}")
|
||||||
|
begin;
|
||||||
|
RubyVM::InstructionSequence.compile("", debug_level: 5)
|
||||||
|
end;
|
||||||
|
|
|
@ -571,4 +571,12 @@ class TestISeq < Test::Unit::TestCase
|
||||||
assert_not_nil(invokebuiltin)
|
assert_not_nil(invokebuiltin)
|
||||||
assert_equal([:func_ptr, :argc, :index, :name], invokebuiltin[1].keys)
|
assert_equal([:func_ptr, :argc, :index, :name], invokebuiltin[1].keys)
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue