diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-12 17:56:50 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-12 17:56:50 +0800 |
commit | ee7ddabf22768c57952e89098db9ffea84475ff7 (patch) | |
tree | 86f7e07c92a1925e9953eaef1755a410ed772f11 /server/test | |
parent | 94da0c9d659f7ac01bf75ccdc37f236e90f8900a (diff) | |
download | lua-language-server-ee7ddabf22768c57952e89098db9ffea84475ff7.zip |
支持函数返回类型
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/main.lua | 2 | ||||
-rw-r--r-- | server/test/type_inference/init.lua | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/server/test/main.lua b/server/test/main.lua index f6b1cede..67e2da0a 100644 --- a/server/test/main.lua +++ b/server/test/main.lua @@ -26,7 +26,7 @@ local function main() test 'vm' test 'definition' test 'diagnostics' - --test 'type_inference' + test 'type_inference' test 'find_lib' print('测试完成') diff --git a/server/test/type_inference/init.lua b/server/test/type_inference/init.lua index 3686451f..c906fdd4 100644 --- a/server/test/type_inference/init.lua +++ b/server/test/type_inference/init.lua @@ -108,3 +108,22 @@ TEST 'number' [[ TEST 'table' [[ <?table?>() ]] + +TEST 'string' [[ +<?x?> = _VERSION +]] + +TEST 'function' [[ +<?x?> = _VERSION.sub +]] + +TEST 'table' [[ +<?x?> = setmetatable({}) +]] + +TEST 'number' [[ +local function x() + return 1 +end +<?y?> = x() +]] |