aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runnable
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/runnable')
-rw-r--r--testsuite/runnable/for_by.elna9
-rw-r--r--testsuite/runnable/for_loop.elna9
-rw-r--r--testsuite/runnable/slice_equality.elna10
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/runnable/for_by.elna b/testsuite/runnable/for_by.elna
new file mode 100644
index 0000000..b219dc6
--- /dev/null
+++ b/testsuite/runnable/for_by.elna
@@ -0,0 +1,9 @@
+var
+ actual: [4]Word := [4]Word{}
+
+begin
+ for i := 1u to 4u by 2u do
+ actual[i] := i
+ end;
+ assert(actual = [4]Word{ 1u, 0u, 3u, 0u })
+end.
diff --git a/testsuite/runnable/for_loop.elna b/testsuite/runnable/for_loop.elna
new file mode 100644
index 0000000..02db679
--- /dev/null
+++ b/testsuite/runnable/for_loop.elna
@@ -0,0 +1,9 @@
+var
+ actual: [4]Word := [4]Word{}
+
+begin
+ for i := 1u to 4u do
+ actual[i] := i * 2u
+ end;
+ assert(actual = [4]Word{ 2u, 4u, 6u, 8u })
+end.
diff --git a/testsuite/runnable/slice_equality.elna b/testsuite/runnable/slice_equality.elna
new file mode 100644
index 0000000..1969088
--- /dev/null
+++ b/testsuite/runnable/slice_equality.elna
@@ -0,0 +1,10 @@
+var
+ lhs_payload, rhs_payload: [3]Int := [3]Int{ 2, 4, 6 }
+ lhs, rhs: []Int
+
+begin
+ lhs := lhs_payload.ptr[1 to 3];
+ rhs := rhs_payload.ptr[1 to 3];
+
+ assert(lhs = rhs)
+end.