From 2e62b41072738142dea9f0b5dd5d2d22455c7616 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Wed, 26 Jun 2024 19:27:42 +0100 Subject: add arrays, appending, getting length, indexing --- tests/arr1.bth | 9 +++++++++ tests/arr1.out | 5 +++++ tests/nilcall.bth | 1 + tests/nilcall.out | 1 + 4 files changed, 16 insertions(+) create mode 100644 tests/arr1.bth create mode 100644 tests/arr1.out create mode 100644 tests/nilcall.bth create mode 100644 tests/nilcall.out (limited to 'tests') diff --git a/tests/arr1.bth b/tests/arr1.bth new file mode 100644 index 0000000..0d06759 --- /dev/null +++ b/tests/arr1.bth @@ -0,0 +1,9 @@ +(set A (arr)) +(say A) +(say (len A)) +(append A 10) +(append A 20) +(append A 30) +(say A) +(say (len A)) +(say (A 1)) diff --git a/tests/arr1.out b/tests/arr1.out new file mode 100644 index 0000000..3e5e246 --- /dev/null +++ b/tests/arr1.out @@ -0,0 +1,5 @@ +[ ] +0 +[ 10 20 30 ] +3 +20 diff --git a/tests/nilcall.bth b/tests/nilcall.bth new file mode 100644 index 0000000..27ff7a2 --- /dev/null +++ b/tests/nilcall.bth @@ -0,0 +1 @@ +(nil 4) diff --git a/tests/nilcall.out b/tests/nilcall.out new file mode 100644 index 0000000..ba2231b --- /dev/null +++ b/tests/nilcall.out @@ -0,0 +1 @@ +cannot call nil -- cgit v1.2.3