From 970d63568f8b22387d7910abf433958257722816 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Tue, 22 Feb 2022 20:43:01 -0500 Subject: [PATCH] Revert "lua: TDD of enabling base lib" This reverts commit d8b3712817e896e7d80a19e2c2b537d285a5a248. --- firmware/controllers/lua/lua.cpp | 3 ++- unit_tests/tests/lua/test_lua_basic.cpp | 19 ------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/firmware/controllers/lua/lua.cpp b/firmware/controllers/lua/lua.cpp index 0170ded3f5..2c28a6ee18 100644 --- a/firmware/controllers/lua/lua.cpp +++ b/firmware/controllers/lua/lua.cpp @@ -140,7 +140,8 @@ static int lua_setTickRate(lua_State* l) { static void loadLibraries(LuaHandle& ls) { constexpr luaL_Reg libs[] = { - { LUA_GNAME, luaopen_base }, + // TODO: do we even need the base lib? + //{ LUA_GNAME, luaopen_base }, { LUA_MATHLIBNAME, luaopen_math }, }; diff --git a/unit_tests/tests/lua/test_lua_basic.cpp b/unit_tests/tests/lua/test_lua_basic.cpp index f6fa2ddd29..5a8cf57c1d 100644 --- a/unit_tests/tests/lua/test_lua_basic.cpp +++ b/unit_tests/tests/lua/test_lua_basic.cpp @@ -25,25 +25,6 @@ TEST(LuaBasic, MathLib) { EXPECT_FLOAT_EQ(result, 1.0f); } -TEST(LuaBasic, iPairs) { - auto script = R"( - function testFunc() - counter = 0 -data = {0x5F, 0x59, 0xFF, 0x00, 0x34, 0x0D, 0x80, 0x99} -for i, v in ipairs(data) do - counter = counter + 1 - end - - return counter - end - )"; - - float result = testLuaReturnsNumber(script); - - EXPECT_FLOAT_EQ(result, 8); -} - - TEST(LuaBasic, MathLibFloor) { auto script = R"( function testFunc()