From 2687363810809f350038acfab2f52f27a3dc51a2 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, 19 Nov 2018 17:11:20 +0800 Subject: =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/definition/init.lua | 214 ++--------------------------------------------- 1 file changed, 5 insertions(+), 209 deletions(-) (limited to 'test/definition/init.lua') diff --git a/test/definition/init.lua b/test/definition/init.lua index f9a0bf3e..88d6a1b9 100644 --- a/test/definition/init.lua +++ b/test/definition/init.lua @@ -1,6 +1,8 @@ local matcher = require 'matcher' -local function test(script) +rawset(_G, 'TEST', true) + +function TEST(script) local start = script:find('', 1, true) - 1 local pos = script:find(' - = 1 -]] - -test [[ -local z, y, - = 1 -]] - -test [[ -local = 1 - = 1 -]] - -test [[ -local z, y, = 1 - = 1 -]] - -test [[ -function () end - = 1 -]] - -test [[ -local function () end - = 1 -]] - -test [[ -local x -local - = 1 -]] - -test [[ -local -do - = 1 -end -]] - -test [[ -local -do - local x -end - = 1 -]] - -test [[ -local -if then - local x -end -]] - -test [[ -local -if x then - local x -elseif then - local x -end -]] - -test [[ -local -if x then - local x -elseif x then - local x -else - local x -end - = 1 -]] - -test [[ -local -if x then - = 1 -elseif x then - local x -else - local x -end -]] - -test [[ -local -for x = 1, 10 do -end - = 1 -]] - -test [[ -local x -for = 1, 10 do - = 1 -end -]] - -test [[ -local -for x in x do -end - = 1 -]] - -test [[ -local -for x in do -end -]] - -test [[ -local x -for in x do - = 1 -end -]] - -test [[ -local x -for z, y, in x do - = 1 -end -]] - -test [[ -local -while do -end -]] - -test [[ -local -while x do - = 1 -end -]] - -test [[ -local -while x do - local x -end - = 1 -]] - -test [[ -local -repeat - = 1 -until true -]] - -test [[ -local -repeat - local x -until true - = 1 -]] - -test [[ -local -repeat -until -]] - -test [[ -local x -repeat - local -until -]] - -test [[ -local -function _() - local x -end - = 1 -]] - -test [[ -local -return function () - = 1 -end -]] - -test [[ -local -local x = function () - = 1 -end -]] - -test [[ -local x -local function () - = 1 -end -]] +require 'definition.local' +require 'definition.arg' -- cgit v1.2.3