diff options
Diffstat (limited to 'testsuite/runnable')
| -rw-r--r-- | testsuite/runnable/array_constructor.elna | 12 | ||||
| -rw-r--r-- | testsuite/runnable/record_construction.elna | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/runnable/array_constructor.elna b/testsuite/runnable/array_constructor.elna new file mode 100644 index 0000000..2ce3578 --- /dev/null +++ b/testsuite/runnable/array_constructor.elna @@ -0,0 +1,12 @@ +var + a: [3]Int := [3]Int{1, 2, 3} + b: [2]Int := [2]Int{4} + +begin + assert(a[1] = 1 & a[2] = 2 & a[3] = 3); + assert(b[1] = 4 & b[2] = 0); + + a := [3]Int{5, 6, 7}; + assert(a[1] = 5 & a[2] = 6 & a[3] = 7) +return 0 +end. diff --git a/testsuite/runnable/record_construction.elna b/testsuite/runnable/record_construction.elna new file mode 100644 index 0000000..00e60db --- /dev/null +++ b/testsuite/runnable/record_construction.elna @@ -0,0 +1,12 @@ +type + R = record + x, y: Int + end + +var + r: R := R{x: 1, y: 2} + +begin + assert(r.x = 1 & r.y = 2) +return 0 +end. |
