IronRuby.Tests.Tests.RubyBlocks16 C# (CSharp) Method

RubyBlocks16() public method

Tests optimization of block break from another block. Yield yields to a block that breaks to its proc-converter, which is foo. So the example should retrun 1 from the foo call. Break is propagated thru yields in two ways: 1) returning ReturnReason == Break via BlockParam (fast path) 2) throwing MethodUnwinder exception (slow path) ReturnReason should be propagated by yields as long as the owner of the block that contains the yield is the target frame for the break. That's the case for for-loop blocks in this test.
public RubyBlocks16 ( ) : void
return void
        public void RubyBlocks16() {
            AssertOutput(delegate() {
                CompilerTest(@"
def foo
    for j in [0]
        for i in [1]
            yield
        end 
        puts 'Unreachable'
    end
    puts 'Unreachable'
end 

x = foo do
    break 1
end
puts x
");
            }, @"1");
        }
Tests