From 91af49cdfd292b7e479e6e0327d04c436256ed7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 11 Nov 2019 19:31:04 +0800 Subject: =?UTF-8?q?=E8=BF=87=E5=8D=95=E6=96=87=E4=BB=B6=20reference=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/test/references/init.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'server-beta/test') diff --git a/server-beta/test/references/init.lua b/server-beta/test/references/init.lua index e66449fb..e009ee19 100644 --- a/server-beta/test/references/init.lua +++ b/server-beta/test/references/init.lua @@ -34,10 +34,10 @@ end function TEST(script) files.removeAll() local target = catch_target(script) - local start = script:find('', 1, true) + local start = script:find('<[?~]') + local finish = script:find('[?~]>') local pos = (start + finish) // 2 + 1 - local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ') + local new_script = script:gsub('<[!?~]', ' '):gsub('[!?~]>', ' ') files.setText('', new_script) local results = core('', pos) @@ -92,13 +92,22 @@ end TEST [[ local function f() - return + return <~ () + end!> end local = f() ]] +TEST [[ +local function f() + return nil, <~ () + end!> +end + +local _, = f() +]] + TEST [[ table.() function table.() -- cgit v1.2.3