From bea414d6baff2666030577311a6b6130ec3d9861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 28 Sep 2021 10:53:34 +0800 Subject: pass tests --- test/crossfile/diagnostic.lua | 1 + test/diagnostics/init.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/crossfile/diagnostic.lua b/test/crossfile/diagnostic.lua index adc2961f..7735f4c5 100644 --- a/test/crossfile/diagnostic.lua +++ b/test/crossfile/diagnostic.lua @@ -6,6 +6,7 @@ local platform = require 'bee.platform' local catch = require 'catch' config.get 'Lua.diagnostics.neededFileStatus'['deprecated'] = 'Any' +config.get 'Lua.diagnostics.neededFileStatus'['type-check'] = 'Any' rawset(_G, 'TEST', true) diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index 1b26c00b..687027b8 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -5,6 +5,7 @@ local util = require 'utility' local catch = require 'catch' config.get 'Lua.diagnostics.neededFileStatus'['deprecated'] = 'Any' +config.get 'Lua.diagnostics.neededFileStatus'['type-check'] = 'Any' rawset(_G, 'TEST', true) @@ -1208,4 +1209,4 @@ local function f(x, y) end f(true, true) -- OK f(0, 0) -- OK -]] \ No newline at end of file +]] -- cgit v1.2.3 From d0ac1fdf3c0ee6b9b04ac69eaeb3c2336381ab14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 28 Sep 2021 12:10:01 +0800 Subject: stash --- test/type_inference/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 13efbc59..e0c7b5c8 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -871,3 +871,10 @@ for _, a in ipairs(v) do end end ]] + +--TEST 'number' [[ +-----@param x number +--local f +-- +--f = function () end +--]] -- cgit v1.2.3 From 1d257a7c89e6077dccf5ed9f539ec140a802e4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 28 Sep 2021 16:12:55 +0800 Subject: stash --- test/diagnostics/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index 687027b8..bb613112 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -461,7 +461,7 @@ f(1, 2, 3) ]] TEST [[ -() +() ]] TEST [[ @@ -1135,6 +1135,9 @@ return { } ]] +-- TODO +do return end + TEST [[ ---@param table table ---@param metatable table -- cgit v1.2.3 From f1a974b7ea759adcd4af571bc7752d5b4761927b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 28 Sep 2021 16:56:57 +0800 Subject: #477 --- test/type_inference/init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index e0c7b5c8..a4dbf249 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -872,9 +872,9 @@ for _, a in ipairs(v) do end ]] ---TEST 'number' [[ ------@param x number ---local f --- ---f = function () end ---]] +TEST 'number' [[ +---@param x number +local f + +f = function () end +]] -- cgit v1.2.3 From c45a21271556b6c689ee61fd5353846f469e4622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 28 Sep 2021 17:44:46 +0800 Subject: #477 supports hover --- test/crossfile/hover.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index 1c46214c..97e6218d 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -969,3 +969,20 @@ p: T | b -- comment 3 -- comment 4 ```]]} + +TEST {{ path = 'a.lua', content = '', }, { + path = 'b.lua', + content = [[ +---@param x number # aaa +local f + +function f() end +]] +}, +hover = [[ +```lua +local x: number +``` + +--- + aaa]]} -- cgit v1.2.3