|
@@ -97,14 +97,14 @@ TEST_CASE("NativeFunction") {
|
|
|
SECTION("with return value") {
|
|
SECTION("with return value") {
|
|
|
REQUIRE(luaL_dostring(state, "return function (x, y) return x + y end") == LUA_OK);
|
|
REQUIRE(luaL_dostring(state, "return function (x, y) return x + y end") == LUA_OK);
|
|
|
|
|
|
|
|
- auto fun = luwra::read<luwra::NativeFunction<int(int, int)>>(state, -1);
|
|
|
|
|
|
|
+ auto fun = luwra::read<luwra::NativeFunction<int>>(state, -1);
|
|
|
REQUIRE(fun(13, 37) == 50);
|
|
REQUIRE(fun(13, 37) == 50);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
SECTION("without return value") {
|
|
SECTION("without return value") {
|
|
|
REQUIRE(luaL_dostring(state, "return function (x, y) returnValue = x + y end") == LUA_OK);
|
|
REQUIRE(luaL_dostring(state, "return function (x, y) returnValue = x + y end") == LUA_OK);
|
|
|
|
|
|
|
|
- auto fun = luwra::read<luwra::NativeFunction<void(int, int)>>(state, -1);
|
|
|
|
|
|
|
+ auto fun = luwra::read<luwra::NativeFunction<void>>(state, -1);
|
|
|
fun(13, 37);
|
|
fun(13, 37);
|
|
|
|
|
|
|
|
int returnValue = state["returnValue"];
|
|
int returnValue = state["returnValue"];
|