diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-10 11:56:04 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-10 11:56:04 +0800 |
commit | 6aa19b14e48d5c81af0cda08362a975392a45565 (patch) | |
tree | 7757fe162dd61d1f08387f9942d7502c3d661d4b /server/test | |
parent | fdc9a81f6f220a9fab4087a6a4d3eb7c346498e6 (diff) | |
download | lua-language-server-6aa19b14e48d5c81af0cda08362a975392a45565.zip |
根据一些运算符来推导
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/type_inference/init.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/server/test/type_inference/init.lua b/server/test/type_inference/init.lua index c4446a51..4097eb2f 100644 --- a/server/test/type_inference/init.lua +++ b/server/test/type_inference/init.lua @@ -70,6 +70,42 @@ local <?t?> t = {} ]] +TEST 'function' [[ +<?x?>() +]] + TEST 'table' [[ <?t?>.x = 1 ]] + +TEST 'boolean' [[ +<?x?> = not y +]] + +TEST 'integer' [[ +<?x?> = #y +]] + +TEST 'number' [[ +<?x?> = - y +]] + +TEST 'integer' [[ +<?x?> = ~ y +]] + +TEST 'boolean' [[ +<?x?> = a and b +]] + +TEST 'integer' [[ +<?x?> = a << b +]] + +TEST 'string' [[ +<?x?> = a .. b +]] + +TEST 'number' [[ +<?x?> = a + b +]] |