diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-11-20 13:44:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-11-20 13:44:31 +0800 |
commit | 8d5bc3299d3bc02f3ff295efc22d9b00f373af7f (patch) | |
tree | 23cb8c5da7ab32337607f7aa8a469192962065ef /test/implementation | |
parent | c6e00ba82ab0e15fbbaad59ef91cfb08caeb6f7d (diff) | |
download | lua-language-server-8d5bc3299d3bc02f3ff295efc22d9b00f373af7f.zip |
先取最后一个实现
Diffstat (limited to 'test/implementation')
-rw-r--r-- | test/implementation/bug.lua | 9 | ||||
-rw-r--r-- | test/implementation/if.lua | 0 | ||||
-rw-r--r-- | test/implementation/init.lua | 8 |
3 files changed, 7 insertions, 10 deletions
diff --git a/test/implementation/bug.lua b/test/implementation/bug.lua index 8f80030b..b0e890ca 100644 --- a/test/implementation/bug.lua +++ b/test/implementation/bug.lua @@ -13,12 +13,3 @@ function _(<!x!>) <?x?> = 1 end ]] - -TEST [[ -local <!x!> -if 1 then - x = 1 -else - <?x?> = 2 -end -]] diff --git a/test/implementation/if.lua b/test/implementation/if.lua new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/implementation/if.lua diff --git a/test/implementation/init.lua b/test/implementation/init.lua index 855bf255..de8d9d63 100644 --- a/test/implementation/init.lua +++ b/test/implementation/init.lua @@ -20,7 +20,7 @@ local function founded(targets, results) while true do local target = table.remove(targets) if not target then - return true + break end for i, result in ipairs(results) do if target[1] == result[1] and target[2] == result[2] then @@ -31,6 +31,11 @@ local function founded(targets, results) do return false end ::CONTINUE:: end + if #results == 0 then + return true + else + return false + end end function TEST(script) @@ -47,5 +52,6 @@ require 'implementation.set' require 'implementation.local' require 'implementation.arg' require 'implementation.function' +require 'implementation.if' --require 'implementation.table' require 'implementation.bug' |