diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-22 23:26:32 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-22 23:26:32 +0800 |
commit | d0ff66c9abe9d6abbca12fd811e0c3cb69c1033a (patch) | |
tree | bb34518d70b85de7656dbdbe958dfa221a3ff3b3 /server-beta/test/full | |
parent | 0a2c2ad15e1ec359171fb0dd4c72e57c5b66e9ba (diff) | |
download | lua-language-server-d0ff66c9abe9d6abbca12fd811e0c3cb69c1033a.zip |
整理一下目录结构
Diffstat (limited to 'server-beta/test/full')
-rw-r--r-- | server-beta/test/full/dirty.lua | 15 | ||||
-rw-r--r-- | server-beta/test/full/example.lua | 43 | ||||
-rw-r--r-- | server-beta/test/full/init.lua | 13 | ||||
-rw-r--r-- | server-beta/test/full/normal.lua | 157 |
4 files changed, 0 insertions, 228 deletions
diff --git a/server-beta/test/full/dirty.lua b/server-beta/test/full/dirty.lua deleted file mode 100644 index 5fe4e998..00000000 --- a/server-beta/test/full/dirty.lua +++ /dev/null @@ -1,15 +0,0 @@ -TEST [[ -a. -]] - -TEST [[ -a: -]] - -TEST [[ -end -]] - -TEST [[ -table.02X -]] diff --git a/server-beta/test/full/example.lua b/server-beta/test/full/example.lua deleted file mode 100644 index 5b096655..00000000 --- a/server-beta/test/full/example.lua +++ /dev/null @@ -1,43 +0,0 @@ -local util = require 'utility' -local parser = require 'parser' -local files = require 'files' -local diag = require 'core.diagnostics' - --- 临时 -local function testIfExit(path) - local buf = util.loadFile(path:string()) - if buf then - local vm - - local clock = os.clock() - local max = 100 - local need - for i = 1, max do - vm = TEST(buf) - local passed = os.clock() - clock - if passed >= 1.0 or i == max then - need = passed / i - break - end - end - print(('基准编译测试[%s]单次耗时:%.10f'):format(path:filename():string(), need)) - - local clock = os.clock() - local max = 100 - local need - local lines = parser:lines(buf) - for i = 1, max do - files.removeAll() - files.setText('', buf) - diag('') - local passed = os.clock() - clock - if passed >= 1.0 or i == max then - need = passed / i - break - end - end - print(('基准诊断测试[%s]单次耗时:%.10f'):format(path:filename():string(), need)) - end -end -testIfExit(ROOT / 'test' / 'example' / 'vm.txt') -testIfExit(ROOT / 'test' / 'example' / 'largeGlobal.txt') diff --git a/server-beta/test/full/init.lua b/server-beta/test/full/init.lua deleted file mode 100644 index f370671e..00000000 --- a/server-beta/test/full/init.lua +++ /dev/null @@ -1,13 +0,0 @@ -local parser = require 'parser' - -rawset(_G, 'TEST', true) - -function TEST(script) - local ast = parser:compile(script, 'lua', 'Lua 5.3') - assert(ast) - return ast -end - -require 'full.normal' -require 'full.example' -require 'full.dirty' diff --git a/server-beta/test/full/normal.lua b/server-beta/test/full/normal.lua deleted file mode 100644 index a673e74b..00000000 --- a/server-beta/test/full/normal.lua +++ /dev/null @@ -1,157 +0,0 @@ -TEST [[ -do - x = 1 -end -]] - -TEST [[ -return nil, 1, true, 'xx' -]] - -TEST [[ -return a -]] - -TEST [[ -retrun a.b:c(1, 2, ...)[1][name] -]] - -TEST [[ -return 1 + 1 -]] - -TEST [[ -return -1 -]] - -TEST [[ -return ... -]] - -TEST [[ -return function (a, b, ...) -end -]] - -TEST [[ -return { - a = 1, - b = { - c = d, - e = f, - }, - g, - h, - 1, -} -]] - -TEST [[ -::LABEL:: -goto LABEL -goto NEXT -::NEXT:: -]] - -TEST [[ -a, b, c = 1, 2, ... -]] - -TEST [[ -local a, b, c = 1, 2, ... -]] - -TEST [[ -a[#a+1] = 1 -]] - -TEST [[ -xx(a, b, 2, 3, ...) -]] - -TEST [[ -if a then -elseif b then -elseif c then -else -end -]] - -TEST [[ -for i = 1, 10, 1 do -end -]] - -TEST [[ -for a, b, c in pairs(t) do -end -]] - -TEST [[ -while true do -end -]] - -TEST [[ -repeat -until true -]] - -TEST [[ -function xx:yy(a, b, c, ...) -end -]] - -TEST [[ -local function xx(a, b, c, ...) -end -]] - -TEST [[ -local v = 1 -local function xx() - print(v) -end -local v = 2 -xx() -]] - -TEST [[ -return { - 1, 2, 3 -} -]] - -TEST [[ -return function () -end -]] - -TEST [[ -t[...] = 1 -]] - -TEST [[ -return { - [...] = ... -} -]] - -TEST [[ --- 选取单位 ----@param center point ----@param radius number ----@param height number ----@return unit[] -function scene:selectByCylinder(center, radius, height) -end -]] - -TEST [[ -local x = , -]] - -TEST [[ ----@type any|fun():nil -local t -]] |