diff options
| author | 彭宣正 <[email protected]> | 2022-09-05 19:03:03 +0800 |
|---|---|---|
| committer | 彭宣正 <[email protected]> | 2022-09-05 19:03:03 +0800 |
| commit | 2a0f0af98db078dc159a138ef8d25048807222ea (patch) | |
| tree | e92eb30a921a28e8fa50bfa23f78510e7ae50629 /gtest/script | |
| parent | fb53526b29c8092aed85ec73f17b470df379e95a (diff) | |
✨ feat(TSG-11870): 修改测试用例
Diffstat (limited to 'gtest/script')
| -rw-r--r-- | gtest/script/call_cfunction_get_value.lua | 15 | ||||
| -rw-r--r-- | gtest/script/call_cfunction_invalid_args.lua | 6 | ||||
| -rw-r--r-- | gtest/script/call_set_repeat.lua | 8 | ||||
| -rw-r--r-- | gtest/script/elua_time_out.lua (renamed from gtest/script/lua_time_out.lua) | 0 | ||||
| -rw-r--r-- | gtest/script/get_header.lua | 2 |
5 files changed, 30 insertions, 1 deletions
diff --git a/gtest/script/call_cfunction_get_value.lua b/gtest/script/call_cfunction_get_value.lua new file mode 100644 index 0000000..044a036 --- /dev/null +++ b/gtest/script/call_cfunction_get_value.lua @@ -0,0 +1,15 @@ +local data = TSG.data + +local value = TSG.get_value() + +local retvalue = nil +print(type(value)) +for k, v in pairs(value) do + if not retvalue then + retvalue = string.format("%s:%s", tostring(k), tostring(v)) + else + retvalue = string.format("%s,%s:%s", retvalue, tostring(k), tostring(v)) + end +end + +return string.len(retvalue), retvalue
\ No newline at end of file diff --git a/gtest/script/call_cfunction_invalid_args.lua b/gtest/script/call_cfunction_invalid_args.lua new file mode 100644 index 0000000..697139e --- /dev/null +++ b/gtest/script/call_cfunction_invalid_args.lua @@ -0,0 +1,6 @@ +local data = TSG.data + +local str = TSG.get.get_hello("test", "Test") + +local ret = TSG.set.set_world(str, "world") +return string.len(ret), ret
\ No newline at end of file diff --git a/gtest/script/call_set_repeat.lua b/gtest/script/call_set_repeat.lua new file mode 100644 index 0000000..7591309 --- /dev/null +++ b/gtest/script/call_set_repeat.lua @@ -0,0 +1,8 @@ +local data = TSG.data; +local ret = TSG.set_repeat() + +if type(ret) == "string" then + return string.len(ret), ret +else + return ret +end
\ No newline at end of file diff --git a/gtest/script/lua_time_out.lua b/gtest/script/elua_time_out.lua index 112dabc..112dabc 100644 --- a/gtest/script/lua_time_out.lua +++ b/gtest/script/elua_time_out.lua diff --git a/gtest/script/get_header.lua b/gtest/script/get_header.lua index 104ddd0..f770d60 100644 --- a/gtest/script/get_header.lua +++ b/gtest/script/get_header.lua @@ -13,7 +13,7 @@ end local rsp_header = nil header = TSG.rsp.get_header() for k, v in pairs(header) do - if not req_header then + if not rsp_header then rsp_header = string.format("%s:%s", k, v) else rsp_header = string.format("%s,%s:%s", rsp_header, k, v) |
