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

19 lines
553 B
Ruby
Raw Normal View History

require 'test/unit'
require_relative 'envutil'
class TestISeq < Test::Unit::TestCase
ISeq = RubyVM::InstructionSequence
def test_no_linenum
bug5894 = '[ruby-dev:45130]'
assert_normal_exit('p RubyVM::InstructionSequence.compile("1", "mac", "", 0).to_a', bug5894)
end
def test_unsupport_type
ary = RubyVM::InstructionSequence.compile("p").to_a
ary[9] = :foobar
e = assert_raise(TypeError) {RubyVM::InstructionSequence.load(ary)}
assert_match(/:foobar/, e.message)
end if defined?(RubyVM::InstructionSequence.load)
end