diff options
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() +]] |