diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-11 16:11:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-11 16:11:46 +0800 |
commit | c89e12dc4282c942ea91edbdb7bcab0657fb1ad6 (patch) | |
tree | 114a6bbf553f79b46fe08fec87d55959278d49f9 /server/test | |
parent | b33b2bf3a6dcf37b507a93b11acbbb85bc8c49b4 (diff) | |
download | lua-language-server-c89e12dc4282c942ea91edbdb7bcab0657fb1ad6.zip |
修正一些BUG
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/definition/init.lua | 6 | ||||
-rw-r--r-- | server/test/vm/init.lua | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/server/test/definition/init.lua b/server/test/definition/init.lua index 263a73cb..216fc6ed 100644 --- a/server/test/definition/init.lua +++ b/server/test/definition/init.lua @@ -47,10 +47,10 @@ function TEST(script) local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ') local ast = parser:ast(new_script) assert(ast) - local results = matcher.vm(ast) - assert(results) + local vm = matcher.vm(ast) + assert(vm) - local result = matcher.definition(results, pos) + local result = matcher.definition(vm, pos) if result then assert(founded(target, result)) else diff --git a/server/test/vm/init.lua b/server/test/vm/init.lua index d8cfb3dc..799fa367 100644 --- a/server/test/vm/init.lua +++ b/server/test/vm/init.lua @@ -6,7 +6,9 @@ rawset(_G, 'TEST', true) function TEST(script) local ast = parser:ast(script) assert(ast) - local results = matcher.vm(ast) + local vm = matcher.vm(ast) + assert(vm) + local results = vm.results assert(results) end @@ -74,6 +76,10 @@ local a, b, c = 1, 2, ... ]] TEST [[ +a[#a+1] = 1 +]] + +TEST [[ xx(a, b, 2, 3, ...) ]] |