diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-16 02:27:50 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-16 02:27:50 +0000 |
commit | ddf295a26f610affd3a22da91852b52594a6477c (patch) | |
tree | a26d62926d686d9cae0888079d38bc5978236a28 /test | |
parent | d3c5746bbb3807a4ccc10ae5da57792aa3f3459e (diff) |
compile.c: fix load_from_binary
* compile.c (ibf_load_iseq_each): realpath may be nil. follow up
r59709. [fix https://github.com/Shopify/bootsnap/issues/132]
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_iseq.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 4c811611ba..1a45778cc4 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -398,10 +398,9 @@ class TestISeq < Test::Unit::TestCase def test_to_binary_with_objects code = "[]"+100.times.map{|i|"<</#{i}/"}.join - bin = assert_nothing_raised { - RubyVM::InstructionSequence.compile(code).to_binary - } - # load_from_binary doesn't work now - assert_instance_of(String, bin) + iseq = RubyVM::InstructionSequence.compile(code) + bin = assert_nothing_raised {iseq.to_binary} + iseq2 = RubyVM::InstructionSequence.load_from_binary(bin) + assert_equal(iseq2.to_a, iseq.to_a) end end |