summaryrefslogtreecommitdiff
path: root/gtest/gtest_lua_remove_cmd.cpp
diff options
context:
space:
mode:
author“pengxuanzheng” <[email protected]>2022-07-19 07:00:35 +0000
committer“pengxuanzheng” <[email protected]>2022-07-19 07:36:03 +0000
commita51a298b5a7e5067873b7854687b3ead6d13d8b7 (patch)
tree9c60776971d58be129e53a64131b9095b19ba5ce /gtest/gtest_lua_remove_cmd.cpp
parented86120fa4072ce922550ae1304e889e15694ef6 (diff)
✨ feat(TSG-11154): 增加remove命令,可以用来移除特定的lua API
Diffstat (limited to 'gtest/gtest_lua_remove_cmd.cpp')
-rw-r--r--gtest/gtest_lua_remove_cmd.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/gtest/gtest_lua_remove_cmd.cpp b/gtest/gtest_lua_remove_cmd.cpp
new file mode 100644
index 0000000..df0c5f1
--- /dev/null
+++ b/gtest/gtest_lua_remove_cmd.cpp
@@ -0,0 +1,17 @@
+#include <gtest/gtest.h>
+#include "tsg_lua_interface.h"
+
+TEST(lua_remove_cmd, normal)
+{
+ tsg_lua_handle L = tsg_lua_vm_create_with_name("TEST");
+ ASSERT_TRUE(L);
+
+ lua_remove_cmd(L, "print");
+
+ char out[1204];
+ size_t len = 1024;
+ size_t type = STRING;
+ int ret = tsg_lua_exec_file(L, "./script/remove_print.lua", "remove print", strlen("remove print"), out, &len, &type);
+ EXPECT_EQ(ret, ERR_SCRIPT_EXEC_ERROR);
+
+} \ No newline at end of file