mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
cb5c2f07f1
commit
64241b0921
2 changed files with 25 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
|||
Sun Dec 28 18:19:28 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* 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]
|
||||
|
||||
Sun Dec 28 16:25:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* cygwin/GNUmakefile.in (EXTOBJS): override to add resource files
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue