summaryrefslogtreecommitdiff
path: root/test/implementation
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-20 14:11:15 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-20 14:11:15 +0800
commit742544183f0b20856eef6a8a3c0302f3fa12ec0a (patch)
tree7019ce384b81242c2bd5b28ede5094e2e9f48bca /test/implementation
parent307700732c915fc81de4ff60513b89735f882567 (diff)
downloadlua-language-server-742544183f0b20856eef6a8a3c0302f3fa12ec0a.zip
转到实现支持猜测逻辑分支
Diffstat (limited to 'test/implementation')
-rw-r--r--test/implementation/if.lua76
1 files changed, 76 insertions, 0 deletions
diff --git a/test/implementation/if.lua b/test/implementation/if.lua
index 0c7eefc8..a9ab8b22 100644
--- a/test/implementation/if.lua
+++ b/test/implementation/if.lua
@@ -6,3 +6,79 @@ else
<?x?> = 1
end
]]
+
+TEST [[
+<!x!> = 1
+if 1 then
+ <!x!> = 1
+else
+ <!x!> = 1
+end
+<?x?> = 1
+]]
+
+TEST [[
+<!x!> = 1
+if 1 then
+ <!x!> = 1
+elseif 1 then
+ <!x!> = 1
+else
+ <!x!> = 1
+end
+<?x?> = 1
+]]
+
+TEST [[
+<!x!> = 1
+if 1 then
+ <!x!> = 1
+elseif 1 then
+ <!x!> = 1
+ if 1 then
+ <!x!> = 1
+ end
+else
+ <!x!> = 1
+end
+<?x?> = 1
+]]
+
+TEST [[
+<!x!> = 1
+while true do
+ <!x!> = 1
+end
+<?x?> = 1
+]]
+
+TEST [[
+<!x!> = 1
+for _ in _ do
+ <!x!> = 1
+end
+<?x?> = 1
+]]
+
+TEST [[
+<!x!> = 1
+for _ = 1, 1 do
+ <!x!> = 1
+end
+<?x?> = 1
+]]
+
+TEST [[
+x = 1
+repeat
+ <!x!> = 1
+until <?x?> == 1
+]]
+
+TEST [[
+<!x!> = 1
+repeat
+ <!x!> = 1
+until 1
+<?x?> = 1
+]]