aboutsummaryrefslogtreecommitdiffstats
path: root/tests/for.tdy
diff options
context:
space:
mode:
Diffstat (limited to 'tests/for.tdy')
-rw-r--r--tests/for.tdy19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/for.tdy b/tests/for.tdy
new file mode 100644
index 0000000..a9f8cd2
--- /dev/null
+++ b/tests/for.tdy
@@ -0,0 +1,19 @@
+a := 0
+for i := 0, i < 3, i = i + 1 {
+ a = a + i
+}
+a <=> 3
+
+a = 0
+for i := 0, i <= 3, i = i + 1 {
+ a = a + i
+}
+a <=> 6
+
+a = 0
+for i := 0, i < 3, i = i + 1 {
+ for j := 0, j < 3, j = j + 1 {
+ a = a + i * j
+ }
+}
+a <=> 9