summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/iota_imp.bth4
-rw-r--r--tests/iota_imp.out1
-rw-r--r--tests/iota_rec.bth7
-rw-r--r--tests/iota_rec.out1
4 files changed, 13 insertions, 0 deletions
diff --git a/tests/iota_imp.bth b/tests/iota_imp.bth
new file mode 100644
index 0000000..cc62db9
--- /dev/null
+++ b/tests/iota_imp.bth
@@ -0,0 +1,4 @@
+(let (a [])
+ (for (i 10)
+ (append a i))
+ (say a))
diff --git a/tests/iota_imp.out b/tests/iota_imp.out
new file mode 100644
index 0000000..0f6e04d
--- /dev/null
+++ b/tests/iota_imp.out
@@ -0,0 +1 @@
+[ 0 1 2 3 4 5 6 7 8 9 ]
diff --git a/tests/iota_rec.bth b/tests/iota_rec.bth
new file mode 100644
index 0000000..8e274a4
--- /dev/null
+++ b/tests/iota_rec.bth
@@ -0,0 +1,7 @@
+(defn (iota' arr i max)
+ (if (< i max)
+ (iota' (append arr i) (+ i 1) max)
+ arr))
+(set! _G_iota' iota')
+(defn (iota n) (_G_iota' [] 0 n))
+(say (iota 10))
diff --git a/tests/iota_rec.out b/tests/iota_rec.out
new file mode 100644
index 0000000..0f6e04d
--- /dev/null
+++ b/tests/iota_rec.out
@@ -0,0 +1 @@
+[ 0 1 2 3 4 5 6 7 8 9 ]