diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-06-23 20:22:26 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-06-23 20:22:26 +0800 |
commit | 7fc2e8d182800a48e99744fc88fef24ca578b18f (patch) | |
tree | cd88b92bbc0bc50a55f0857db52b63dabdeb7e9a /test/type_inference | |
parent | d2667b5943f41ec16b5e54a4d64c497bef149b59 (diff) | |
download | lua-language-server-7fc2e8d182800a48e99744fc88fef24ca578b18f.zip |
add integer
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/init.lua | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index c23d12f5..0ea6b96c 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -772,3 +772,53 @@ TEST 'string|fun():string' [[ ---@type string | fun(): string local <?t?> ]] + +TEST 'string' [[ +local valids = { + ['Lua 5.1'] = false, + ['Lua 5.2'] = false, + ['Lua 5.3'] = false, + ['Lua 5.4'] = false, + ['LuaJIT'] = false, +} + +for <?k?>, v in pairs(valids) do +end +]] + +TEST 'boolean' [[ +local valids = { + ['Lua 5.1'] = false, + ['Lua 5.2'] = false, + ['Lua 5.3'] = false, + ['Lua 5.4'] = false, + ['LuaJIT'] = false, +} + +for k, <?v?> in pairs(valids) do +end +]] + +TEST 'string' [[ +local t = { + a = 1, + b = 1, +} + +for <?k?>, v in pairs(t) do +end +]] + +TEST 'integer' [[ +local t = {'a', 'b'} + +for <?k?>, v in pairs(t) do +end +]] + +TEST 'string' [[ +local t = {'a', 'b'} + +for k, <?v?> in pairs(t) do +end +]] |