From 7fc2e8d182800a48e99744fc88fef24ca578b18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 23 Jun 2021 20:22:26 +0800 Subject: add integer --- test/type_inference/init.lua | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'test') 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 ]] + +TEST 'string' [[ +local valids = { + ['Lua 5.1'] = false, + ['Lua 5.2'] = false, + ['Lua 5.3'] = false, + ['Lua 5.4'] = false, + ['LuaJIT'] = false, +} + +for , 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, in pairs(valids) do +end +]] + +TEST 'string' [[ +local t = { + a = 1, + b = 1, +} + +for , v in pairs(t) do +end +]] + +TEST 'integer' [[ +local t = {'a', 'b'} + +for , v in pairs(t) do +end +]] + +TEST 'string' [[ +local t = {'a', 'b'} + +for k, in pairs(t) do +end +]] -- cgit v1.2.3