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
2b34d005
Commit
2b34d005
authored
Sep 15, 2013
by
Vinicius Jarina
Browse files
Merge pull request #43 from vontio/master
Add varargs test
parents
d898c805
9658dbff
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/LuaTests.cs
View file @
2b34d005
...
@@ -1805,5 +1805,18 @@ namespace NLuaTest
...
@@ -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 @
2b34d005
...
@@ -565,5 +565,15 @@ namespace NLuaTest.Mock
...
@@ -565,5 +565,15 @@ namespace NLuaTest.Mock
k
=
5
;
k
=
5
;
Console
.
WriteLine
(
"Overload with out param"
+
i
+
", "
+
j
);
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