Commit d9f48a2b authored by vontio's avatar vontio
Browse files

add varargs test

parent 65ff3a80
......@@ -1805,5 +1805,18 @@ namespace NLuaTest
}
}
[Test]
public void TestVarargs()
{
using(Lua lua = new Lua()){
lua.DoString ("luanet.load_assembly('mscorlib')");
lua.DoString ("luanet.load_assembly('NLuaTest')");
lua.DoString ("TestClass=luanet.import_type('NLuaTest.Mock.TestClass')");
lua.DoString ("test=TestClass()");
lua.DoString ("test:Print('this will pass')");
lua.DoString ("test:Print('this will ','fail')");
}
}
}
}
......@@ -565,5 +565,15 @@ namespace NLuaTest.Mock
k = 5;
Console.WriteLine ("Overload with out param" + i + ", " + j);
}
public void Print(params object[] msgs)
{
var output = "";
foreach(var msg in msgs)
{
output += msg.ToString() + "\t";
}
Console.WriteLine(output);
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment