Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
d9f48a2b
Commit
d9f48a2b
authored
Sep 13, 2013
by
vontio
Browse files
add varargs test
parent
65ff3a80
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/LuaTests.cs
View file @
d9f48a2b
...
...
@@ -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')"
);
}
}
}
}
tests/TestLua.cs
View file @
d9f48a2b
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment