mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
486086ffe0
notably, test normal + single + generated + Lua 5.3.5 only once, then only run the runtime_test and compile_test for normal for all other permutations to help increase text matrix throughput
19 lines
280 B
C++
19 lines
280 B
C++
#define SOL_CHECK_ARGUMENTS 1
|
|
|
|
#include <sol/sol.hpp>
|
|
#include <assert.hpp>
|
|
|
|
int main() {
|
|
sol::state lua;
|
|
int x = 0;
|
|
lua.set_function("beep", [&x]{ ++x; });
|
|
lua.script("beep()");
|
|
c_assert(x == 1);
|
|
|
|
sol::function beep = lua["beep"];
|
|
beep();
|
|
c_assert(x == 2);
|
|
|
|
return 0;
|
|
}
|