summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-28 09:20:21 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-28 09:20:21 +0000
commit64241b0921e2ae24dd69d225e5d59de5dde77ac5 (patch)
tree78f889b6d1f260100ebbd94e929c014304b291cb /test/-ext-
parentcb5c2f07f1fec26fea713286cdcd5813c9643b48 (diff)
test_iseq_load: expand tests with stack mismatches
We can ensure the loader works for these cases even if the reoptimized bytecode is not a match for the original. * test/-ext-/iseq_load/test_iseq_load.rb (test_next_in_block_in_block): test using ISeq#eval (test_break_ensure): ditto [ruby-core:66988] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/iseq_load/test_iseq_load.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/-ext-/iseq_load/test_iseq_load.rb b/test/-ext-/iseq_load/test_iseq_load.rb
index 5bbd49efba..7251603b0a 100644
--- a/test/-ext-/iseq_load/test_iseq_load.rb
+++ b/test/-ext-/iseq_load/test_iseq_load.rb
@@ -52,16 +52,21 @@ class TestIseqLoad < Test::Unit::TestCase
end
def test_next_in_block_in_block
- skip "failing due to stack_max mismatch"
- assert_iseq_roundtrip <<-'end;'
- 3.times { 3.times { next } }
+ @next_broke = false
+ src = <<-'end;'
+ 3.times { 3.times { next; @next_broke = true } }
end;
+ a = ISeq.compile(src).to_a
+ iseq = ISeq.iseq_load(a)
+ iseq.eval
+ assert_equal false, @next_broke
+ skip "failing due to stack_max mismatch"
+ assert_iseq_roundtrip(src)
end
def test_break_ensure
- skip "failing due to exception entry sp mismatch"
- assert_iseq_roundtrip <<-'end;'
- def m
+ src = <<-'end;'
+ def test_break_ensure_def_method
bad = true
while true
begin
@@ -70,8 +75,15 @@ class TestIseqLoad < Test::Unit::TestCase
bad = false
end
end
+ bad
end
end;
+ a = ISeq.compile(src).to_a
+ iseq = ISeq.iseq_load(a)
+ iseq.eval
+ assert_equal false, test_break_ensure_def_method
+ skip "failing due to exception entry sp mismatch"
+ assert_iseq_roundtrip(src)
end
# FIXME: still failing