From 6c97dc8eaae16214a2127f84deca30f2ca6206a3 Mon Sep 17 00:00:00 2001 From: sumneko Date: Sun, 23 Jan 2022 04:37:55 +0800 Subject: fix #920 --- test/completion/common.lua | 7 +++++++ test/completion/init.lua | 12 ++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'test/completion') diff --git a/test/completion/common.lua b/test/completion/common.lua index b03d55ca..6affbc8f 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -3060,3 +3060,10 @@ local t t:testFunc2() ]] (EXISTS) + +TEST [[ +require '' +]] +(function (results) + assert(#results == 11) +end) diff --git a/test/completion/init.lua b/test/completion/init.lua index 1b2aaf2d..95da8890 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -110,11 +110,15 @@ function TEST(script) end assert(result) result.complete = nil - if expect.include then - expect.include = nil - assert(include(expect, result)) + if type(expect) == 'function' then + expect(result) else - assert(eq(expect, result)) + if expect.include then + expect.include = nil + assert(include(expect, result)) + else + assert(eq(expect, result)) + end end files.remove('') end -- cgit v1.2.3