From 34c2d6ac30f9d990d4008f52c6436aae68fb2844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 5 Dec 2018 16:45:36 +0800 Subject: =?UTF-8?q?=E8=BD=AC=E5=88=B0=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/test/implementation/init.lua | 59 ------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 server/test/implementation/init.lua (limited to 'server/test/implementation/init.lua') diff --git a/server/test/implementation/init.lua b/server/test/implementation/init.lua deleted file mode 100644 index 94db86fc..00000000 --- a/server/test/implementation/init.lua +++ /dev/null @@ -1,59 +0,0 @@ -local matcher = require 'matcher' -local parser = require 'parser' - -rawset(_G, 'TEST', true) - -local function catch_target(script) - local list = {} - local cur = 1 - while true do - local start, finish = script:find('', cur) - if not start then - break - end - list[#list+1] = { start + 2, finish - 2 } - cur = finish + 1 - end - return list -end - -local function founded(targets, results) - while true do - local target = table.remove(targets) - if not target then - break - end - for i, result in ipairs(results) do - if target[1] == result[1] and target[2] == result[2] then - table.remove(results, i) - goto CONTINUE - end - end - do return false end - ::CONTINUE:: - end - if #results == 0 then - return true - else - return false - end -end - -function TEST(script) - local target = catch_target(script) - local pos = script:find('', ' ') - local ast, err = parser:ast(new_script) - assert(ast) - local suc, result = matcher.implementation(ast, pos) - assert(suc) - assert(founded(target, result)) -end - -require 'implementation.set' -require 'implementation.local' -require 'implementation.arg' -require 'implementation.function' -require 'implementation.if' ---require 'implementation.table' -require 'implementation.bug' -- cgit v1.2.3