summaryrefslogtreecommitdiff
path: root/server/test/implementation/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-05 16:45:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-05 16:45:36 +0800
commit34c2d6ac30f9d990d4008f52c6436aae68fb2844 (patch)
treec17f19ebcedc322fb62fe04fc264e2a04c9383d2 /server/test/implementation/init.lua
parent7f3aa8ed3eba0f07a4bd258407f3eaa038f2ce6f (diff)
downloadlua-language-server-34c2d6ac30f9d990d4008f52c6436aae68fb2844.zip
转到实现
Diffstat (limited to 'server/test/implementation/init.lua')
-rw-r--r--server/test/implementation/init.lua59
1 files changed, 0 insertions, 59 deletions
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('<?', 1, true) + 2
- local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- 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'