aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/compilable/compile_time_array_length.elna5
-rw-r--r--testsuite/fail_compilation/compile_time_array_ptr.elna5
-rw-r--r--testsuite/runnable/slice_equality.elna4
-rw-r--r--testsuite/runnable/slice_slice.elna2
4 files changed, 13 insertions, 3 deletions
diff --git a/testsuite/compilable/compile_time_array_length.elna b/testsuite/compilable/compile_time_array_length.elna
new file mode 100644
index 0000000..1ce8956
--- /dev/null
+++ b/testsuite/compilable/compile_time_array_length.elna
@@ -0,0 +1,5 @@
+var
+ source: [3]Int := [3]Int{ 1, 2, 3}
+ target: Word := source.length
+
+end.
diff --git a/testsuite/fail_compilation/compile_time_array_ptr.elna b/testsuite/fail_compilation/compile_time_array_ptr.elna
new file mode 100644
index 0000000..dd626a6
--- /dev/null
+++ b/testsuite/fail_compilation/compile_time_array_ptr.elna
@@ -0,0 +1,5 @@
+var
+ source: [3]Int := [3]Int{ 1, 2, 3}
+ target: ^Int := source.ptr (* @Error Variable initializers must be constant expressions *)
+
+end.
diff --git a/testsuite/runnable/slice_equality.elna b/testsuite/runnable/slice_equality.elna
index 1969088..712ae7a 100644
--- a/testsuite/runnable/slice_equality.elna
+++ b/testsuite/runnable/slice_equality.elna
@@ -3,8 +3,8 @@ var
lhs, rhs: []Int
begin
- lhs := lhs_payload.ptr[1 to 3];
- rhs := rhs_payload.ptr[1 to 3];
+ lhs := lhs_payload[1 to 3];
+ rhs := rhs_payload[1 to 3];
assert(lhs = rhs)
end.
diff --git a/testsuite/runnable/slice_slice.elna b/testsuite/runnable/slice_slice.elna
index d6f309f..cce45ee 100644
--- a/testsuite/runnable/slice_slice.elna
+++ b/testsuite/runnable/slice_slice.elna
@@ -3,7 +3,7 @@ var
slice1, slice2: []Int
begin
- slice1 := array.ptr[1 to array.length];
+ slice1 := array[1 to array.length];
slice2 := slice1[2 to 4];
assert(slice2.length = 3u);