summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-10 11:03:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-10 11:03:12 +0800
commitbe6e0ee6d31d79005691b982c02e7699a7ae3762 (patch)
tree15bca6f55c6acd92bcfcb772a9008efe0d6dc594 /server/test
parentd19514f1904557a464467bfc9540882b4a214840 (diff)
downloadlua-language-server-be6e0ee6d31d79005691b982c02e7699a7ae3762.zip
布尔和数字
Diffstat (limited to 'server/test')
-rw-r--r--server/test/definition/method.lua4
-rw-r--r--server/test/find_lib/init.lua4
-rw-r--r--server/test/type_inference/init.lua8
3 files changed, 12 insertions, 4 deletions
diff --git a/server/test/definition/method.lua b/server/test/definition/method.lua
index 05820e97..5e90177b 100644
--- a/server/test/definition/method.lua
+++ b/server/test/definition/method.lua
@@ -46,7 +46,7 @@ mt.__index = mt
function mt:<!method1!>()
end
-local obj = setmetatable(1, mt)
+local obj = setmetatable({}, mt)
obj:<?method1?>()
]]
@@ -55,7 +55,7 @@ local mt
function mt:<!method1!>()
end
-local obj = setmetatable(1, { __index = mt })
+local obj = setmetatable({}, { __index = mt })
obj:<?method1?>()
]]
diff --git a/server/test/find_lib/init.lua b/server/test/find_lib/init.lua
index 18b88399..26dbc893 100644
--- a/server/test/find_lib/init.lua
+++ b/server/test/find_lib/init.lua
@@ -78,7 +78,7 @@ require 'table'.<?insert?>()
TEST '*string:sub' [[
local str = 'xxx'
-str.<?sub?> = 1
+str.<?sub?>()
]]
TEST '*string:sub' [[
@@ -87,7 +87,7 @@ str:<?sub?>(1, 1)
]]
TEST '*string:sub' [[
-('xxx').<?sub?> = 1
+('xxx').<?sub?>()
]]
TEST 'bee::filesystem' [[
diff --git a/server/test/type_inference/init.lua b/server/test/type_inference/init.lua
index ee47b223..913228bb 100644
--- a/server/test/type_inference/init.lua
+++ b/server/test/type_inference/init.lua
@@ -26,3 +26,11 @@ end
TEST 'string' [[
local <?var?> = '111'
]]
+
+TEST 'boolean' [[
+local <?var?> = true
+]]
+
+TEST 'number' [[
+local <?var?> = 1
+]]