summaryrefslogtreecommitdiff
path: root/test/implementation/if.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/implementation/if.lua')
-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
+]]