From e87c7b5567053de3d94f06c823a0d0962756b237 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, 10 Dec 2019 19:43:12 +0800 Subject: =?UTF-8?q?=E6=94=AF=E6=8C=81=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test-beta/completion/init.lua | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'test-beta') diff --git a/test-beta/completion/init.lua b/test-beta/completion/init.lua index 3a47f6db..bebe481b 100644 --- a/test-beta/completion/init.lua +++ b/test-beta/completion/init.lua @@ -15,22 +15,14 @@ local function eq(a, b) if tp1 == 'table' then local mark = {} for k in pairs(a) do - if type(k) == 'number' - or k == 'label' - or k == 'kind' then - if not eq(a[k], b[k]) then - return false - end - mark[k] = true + if not eq(a[k], b[k]) then + return false end + mark[k] = true end for k in pairs(b) do - if type(k) == 'number' - or k == 'label' - or k == 'kind' then - if not mark[k] then - return false - end + if not mark[k] then + return false end end return true @@ -48,6 +40,13 @@ function TEST(script) files.setText('', new_script) local result = core.completion('', pos) + for _, item in ipairs(result) do + for k in pairs(item) do + if k ~= 'label' and k ~= 'kind' then + item[k] = nil + end + end + end if expect then assert(result) assert(eq(expect, result)) @@ -167,13 +166,12 @@ TEST [[ local t = { abc = 1, } -t.a$ +t.ab$ ]] { { label = 'abc', kind = CompletionItemKind.Enum, - detail = '(number) = 1', } } -- cgit v1.2.3