From 5cc2947143f2a6ebd4ef1ae4d25ab956b87de808 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Tue, 21 Jul 2026 21:27:03 +0200 Subject: Redefine strings as slice of constant characters --- testsuite/runnable/slice_pointer.elna | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 testsuite/runnable/slice_pointer.elna (limited to 'testsuite/runnable/slice_pointer.elna') diff --git a/testsuite/runnable/slice_pointer.elna b/testsuite/runnable/slice_pointer.elna new file mode 100644 index 0000000..d053f51 --- /dev/null +++ b/testsuite/runnable/slice_pointer.elna @@ -0,0 +1,11 @@ +var + array: [3]Int := [3]Int{ 2, 4, 6 } + slice: []Int + +begin + slice := array.ptr[1 to 3]; + + assert(slice.length = 3u); + assert(slice[1] = 2); + assert(slice[3] = 6) +end. -- cgit v1.2.3