From 58327525051d0e282b4bc2d0d7ddd1bbad2e9b65 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 26 Oct 2011 15:06:49 -0700 Subject: Adding Lua. --- tests/test-Lua.cc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/test-Lua.cc (limited to 'tests') diff --git a/tests/test-Lua.cc b/tests/test-Lua.cc new file mode 100644 index 0000000..86baffb --- /dev/null +++ b/tests/test-Lua.cc @@ -0,0 +1,33 @@ +#include +#include + +BALAU_STARTUP; + +using namespace Balau; + +void MainTask::Do() { + Printer::log(M_STATUS, "Test::Lua running."); + + Lua L; + + // yeah, they really should be the same thing. + Assert(sizeof(L) == sizeof(lua_State *)); + + L.open_base(); + L.open_table(); + L.open_string(); + L.open_math(); + L.open_debug(); + L.open_bit(); + L.open_jit(); + + Assert(L.gettop() == 0); + L.load("return 42"); + Assert(L.gettop() == 1); + int r = L.tonumber(); + Assert(r == 42); + L.pop(); + Assert(L.gettop() == 0); + + Printer::log(M_STATUS, "Test::Lua passed."); +} -- cgit v1.2.3