aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-01 00:37:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-01 00:37:47 +0000
commit7d34ed6ecb9506847c4c85170d8df351b5678ad0 (patch)
treea5b649021d5c055a40f61c08c4154c68b5754d76 /test
parent7d55ee287b86bf16dfdb13f4aaa804fca9cfb800 (diff)
downloadruby-7d34ed6ecb9506847c4c85170d8df351b5678ad0.tar.gz
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_iseq.rb9
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