aboutsummaryrefslogtreecommitdiff
path: root/tests/i/while-do
diff options
context:
space:
mode:
Diffstat (limited to 'tests/i/while-do')
-rw-r--r--tests/i/while-do/case.json1
-rw-r--r--tests/i/while-do/expected.txt1
-rw-r--r--tests/i/while-do/notes.md3
-rw-r--r--tests/i/while-do/program.cps6
4 files changed, 11 insertions, 0 deletions
diff --git a/tests/i/while-do/case.json b/tests/i/while-do/case.json
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/tests/i/while-do/case.json
@@ -0,0 +1 @@
+{}
diff --git a/tests/i/while-do/expected.txt b/tests/i/while-do/expected.txt
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/tests/i/while-do/expected.txt
@@ -0,0 +1 @@
+2
diff --git a/tests/i/while-do/notes.md b/tests/i/while-do/notes.md
new file mode 100644
index 0000000..01e389c
--- /dev/null
+++ b/tests/i/while-do/notes.md
@@ -0,0 +1,3 @@
+# while-do
+
+The legacy WHILE DO spelling and the standard WHILE spelling are both accepted. X advances from 0 through 1 to 2, then the loop stops.
diff --git a/tests/i/while-do/program.cps b/tests/i/while-do/program.cps
new file mode 100644
index 0000000..58d6319
--- /dev/null
+++ b/tests/i/while-do/program.cps
@@ -0,0 +1,6 @@
+DECLARE X : INTEGER
+X <- 0
+WHILE X < 2 DO
+ X <- X + 1
+ENDWHILE
+OUTPUT X