test_iseq.rb: skip iseq with coverage

* test/ruby/test_iseq.rb (test_to_binary_with_objects): #to_binary
  does not support iseq compiled with coverage, just skip.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-03-16 12:06:55 +00:00
Родитель 94c40622f5
Коммит 1d07bb84f8
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -399,7 +399,12 @@ class TestISeq < Test::Unit::TestCase
def test_to_binary_with_objects def test_to_binary_with_objects
code = "[]"+100.times.map{|i|"<</#{i}/"}.join code = "[]"+100.times.map{|i|"<</#{i}/"}.join
iseq = RubyVM::InstructionSequence.compile(code) iseq = RubyVM::InstructionSequence.compile(code)
bin = assert_nothing_raised {iseq.to_binary} bin = assert_nothing_raised do
iseq.to_binary
rescue RuntimeError => e
skip e.message if /compile with coverage/ =~ e.message
raise
end
iseq2 = RubyVM::InstructionSequence.load_from_binary(bin) iseq2 = RubyVM::InstructionSequence.load_from_binary(bin)
assert_equal(iseq2.to_a, iseq.to_a) assert_equal(iseq2.to_a, iseq.to_a)
end end