From a559125a2d7af771784614b7a2092cc7fb707345 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Wed, 26 Jun 2024 22:45:16 +0100 Subject: array literals --- tests/arr2.bth | 1 + tests/arr2.out | 1 + tests/arr3.bth | 1 + tests/arr3.out | 1 + tests/arr4.bth | 4 ++++ tests/arr4.out | 1 + tests/arr5.bth | 3 +++ tests/arr5.out | 1 + 8 files changed, 13 insertions(+) create mode 100644 tests/arr2.bth create mode 100644 tests/arr2.out create mode 100644 tests/arr3.bth create mode 100644 tests/arr3.out create mode 100644 tests/arr4.bth create mode 100644 tests/arr4.out create mode 100644 tests/arr5.bth create mode 100644 tests/arr5.out (limited to 'tests') diff --git a/tests/arr2.bth b/tests/arr2.bth new file mode 100644 index 0000000..a405bde --- /dev/null +++ b/tests/arr2.bth @@ -0,0 +1 @@ +(say (append [1 2 3 4] 99)) diff --git a/tests/arr2.out b/tests/arr2.out new file mode 100644 index 0000000..42a9264 --- /dev/null +++ b/tests/arr2.out @@ -0,0 +1 @@ +[ 1 2 3 4 99 ] diff --git a/tests/arr3.bth b/tests/arr3.bth new file mode 100644 index 0000000..c2bce88 --- /dev/null +++ b/tests/arr3.bth @@ -0,0 +1 @@ +(say (append [1 2 (+ 1 2) (let (x 2) (* x x))] (+ 2 3))) diff --git a/tests/arr3.out b/tests/arr3.out new file mode 100644 index 0000000..f5d7903 --- /dev/null +++ b/tests/arr3.out @@ -0,0 +1 @@ +[ 1 2 3 4 5 ] diff --git a/tests/arr4.bth b/tests/arr4.bth new file mode 100644 index 0000000..2521e63 --- /dev/null +++ b/tests/arr4.bth @@ -0,0 +1,4 @@ +(say + (let (A (append [1 2 3 (let (x 2) (* x x)) 5] 6)) + (let (B (append A 7)) (append B 8)) + (append (append A 9) 10))) diff --git a/tests/arr4.out b/tests/arr4.out new file mode 100644 index 0000000..c508125 --- /dev/null +++ b/tests/arr4.out @@ -0,0 +1 @@ +[ 1 2 3 4 5 6 7 8 9 10 ] diff --git a/tests/arr5.bth b/tests/arr5.bth new file mode 100644 index 0000000..79d5a7d --- /dev/null +++ b/tests/arr5.bth @@ -0,0 +1,3 @@ +(set A [1 2 3]) +(let (B A) (append B 10)) +(say A) diff --git a/tests/arr5.out b/tests/arr5.out new file mode 100644 index 0000000..7704f22 --- /dev/null +++ b/tests/arr5.out @@ -0,0 +1 @@ +[ 1 2 3 10 ] -- cgit v1.2.3