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
2722c72e
Commit
2722c72e
authored
May 11, 2021
by
Vlad Soroka
Committed by
Vinicius Jarina
May 11, 2021
Browse files
Adding UT
parent
135495f2
Changes
2
Show whitespace changes
Inline
Side-by-side
tests/src/LuaTests.cs
View file @
2722c72e
...
@@ -198,6 +198,13 @@ namespace NLuaTest
...
@@ -198,6 +198,13 @@ namespace NLuaTest
lua.DoString("i = test:MethodOverload(2,2)\r\nprint(i)");
lua.DoString("i = test:MethodOverload(2,2)\r\nprint(i)");
int i = (int) lua.GetNumber("i");
int i = (int) lua.GetNumber("i");
Assert.AreEqual(5, i, "#1");
Assert.AreEqual(5, i, "#1");
lua.DoString("v = test:MethodOverload2(11)");
var value = lua.GetString("v");
Assert.AreEqual("uint32:11", value, "#2");
lua.DoString("v = test:MethodOverload2('321')");
value = lua.GetString("v");
Assert.AreEqual("string:321", value, "#3");
}
}
}
}
...
...
tests/src/TestTypes/TestClass.cs
View file @
2722c72e
...
@@ -296,6 +296,20 @@ namespace NLuaTest.TestTypes
...
@@ -296,6 +296,20 @@ namespace NLuaTest.TestTypes
Console
.
WriteLine
(
"Overload with out param"
+
i
+
", "
+
j
);
Console
.
WriteLine
(
"Overload with out param"
+
i
+
", "
+
j
);
}
}
public
string
MethodOverload2
(
uint
i
)
{
Console
.
WriteLine
(
"Overload with uint32 param: "
+
i
);
return
$"uint32:
{
i
}
"
;
}
public
string
MethodOverload2
(
string
i
)
{
Console
.
WriteLine
(
"Overload with numeric string param: "
+
i
);
return
$"string:
{
i
}
"
;
}
public
void
Print
(
object
format
,
params
object
[]
args
)
public
void
Print
(
object
format
,
params
object
[]
args
)
{
{
//just for test,this is not printf implements
//just for test,this is not printf implements
...
...
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