Merge pull request #872 from starkos/quiet-binmodule-test-output

Rework binmodule example to silence unit test console output
This commit is contained in:
Samuel Surtees 2017-08-11 12:48:34 +10:00 committed by GitHub
commit 5a75b7e488
2 changed files with 5 additions and 4 deletions

View File

@ -3,9 +3,9 @@
static int example_test(lua_State* L)
{
const char* text = luaL_checkstring(L, 1);
printf("%s\n", text);
lua_pushboolean(L, 1);
lua_pushstring(L, "hello ");
lua_pushvalue(L, 1);
lua_concat(L, 2);
return 1;
}

View File

@ -14,5 +14,6 @@
function suite.testExample()
test.istrue(example.test("hello world"));
local result = example.test("world")
test.isequal("hello world", result)
end