diff options
Diffstat (limited to 'test')
-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 +]] |