summaryrefslogtreecommitdiff
path: root/gtest/gtest_tsg_lua_exec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gtest/gtest_tsg_lua_exec.cpp')
-rw-r--r--gtest/gtest_tsg_lua_exec.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtest/gtest_tsg_lua_exec.cpp b/gtest/gtest_tsg_lua_exec.cpp
index 8f52ce8..1be5bcc 100644
--- a/gtest/gtest_tsg_lua_exec.cpp
+++ b/gtest/gtest_tsg_lua_exec.cpp
@@ -499,3 +499,22 @@ TEST(tsg_lua_exec, function_invaild)
EXPECT_STREQ("", out);
}
#endif
+
+TEST(tsg_lua_exec, sharp)
+{
+ tsg_lua_handle L = NULL;
+ char out[255];
+ size_t out_len = 0;
+ size_t out_type = 0;
+
+ L = tsg_lua_vm_create();
+ memset(out, 0, 255);
+ const char *script = get_script_buffer("./script/return_string_normal_sharp.lua");
+ int ret = tsg_lua_exec(L, script, strlen(script), data, strlen(data), out, &out_len, &out_type);
+
+ /* check */
+ EXPECT_EQ(0, ret);
+ EXPECT_EQ(11, out_len);
+ EXPECT_EQ(STRING, out_type);
+ EXPECT_STREQ("hello world", out);
+}