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

Scenario_RubyArgSplatting4() public method

Splat anything that's IList (including arrays and values passed via out parameters).
public Scenario_RubyArgSplatting4 ( ) : void
return void
        public void Scenario_RubyArgSplatting4() {
            AssertOutput(delegate() {
                CompilerTest(@"
a,b,c = System::Array[Fixnum].new([1,2,3])
p [a,b,c]

def y1; yield System::Array[Fixnum].new([4]); end
def y2; yield System::Array[Fixnum].new([4,5]); end
def y3; yield System::Array[Fixnum].new([4,5,6]); end
def y10; yield System::Array[Fixnum].new([1,2,3,4,5,6,7,8,9,10]); end

y1 { |x| p [x] }
y2 { |x,y| p [x,y] }
y3 { |x,y,z| p [x,y,z] }
y10 { |a1,a2,a3,a4,a5,a6,a7,a8,a9,a10| p [a1,a2,a3,a4,a5,a6,a7,a8,a9,a10] }

dict = System::Collections::Generic::Dictionary[Fixnum, Fixnum].new
dict.add(1,1)
has_value, value = dict.try_get_value(1)
p [has_value, value]
");
            }, @"
[1, 2, 3]
[[4]]
[4, 5]
[4, 5, 6]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[true, 1]
");
        }
Tests