summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-26 14:48:27 +0100
committerubq323 <ubq323@ubq323.website>2024-06-26 14:48:27 +0100
commit517e9fe048844533d927c4e3b6d021f82ccea984 (patch)
tree5629a6d2e43201c14a8d43d652751ff8a987eefb /tests
parenta8519434f058d0ab60bf7f90acc61997cb982cfa (diff)
remove OP_PUTS and OP_PRINT, use say and write functions instead
Diffstat (limited to 'tests')
-rw-r--r--tests/fizzbuzz.bth2
-rw-r--r--tests/four.bth2
-rw-r--r--tests/func1.bth2
-rw-r--r--tests/func2.bth6
-rw-r--r--tests/func3.bth4
-rw-r--r--tests/func4.bth2
-rw-r--r--tests/mandel.bth4
-rw-r--r--tests/mandel_local.bth4
-rw-r--r--tests/multi.bth4
-rw-r--r--tests/vars.bth8
-rw-r--r--tests/vars1.bth2
-rw-r--r--tests/vars2.bth2
-rw-r--r--tests/vars3.bth2
-rw-r--r--tests/vars4.bth8
14 files changed, 26 insertions, 26 deletions
diff --git a/tests/fizzbuzz.bth b/tests/fizzbuzz.bth
index 42c1760..2837b55 100644
--- a/tests/fizzbuzz.bth
+++ b/tests/fizzbuzz.bth
@@ -1,6 +1,6 @@
(set n 1)
(while (< n 30)
- (puts
+ (say
(if (= 0 (% n 5))
(if (= 0 (% n 3)) "fizzbuzz" "buzz")
(if (= 0 (% n 3)) "fizz" n)))
diff --git a/tests/four.bth b/tests/four.bth
index c44e487..c4df4e1 100644
--- a/tests/four.bth
+++ b/tests/four.bth
@@ -1 +1 @@
-(puts (+ 2 2))
+(say (+ 2 2))
diff --git a/tests/func1.bth b/tests/func1.bth
index 1f175ab..a71d160 100644
--- a/tests/func1.bth
+++ b/tests/func1.bth
@@ -1,2 +1,2 @@
(set f (fn (_) 42))
-(puts (f 0))
+(say (f 0))
diff --git a/tests/func2.bth b/tests/func2.bth
index ee995fa..e57bc27 100644
--- a/tests/func2.bth
+++ b/tests/func2.bth
@@ -1,5 +1,5 @@
(set f1 (fn (a) (* a a)))
(set f2 (fn (a b) (+ a b)))
-(puts (f1 6))
-(puts (f2 20 40))
-(puts (f1 (f2 2 1)))
+(say (f1 6))
+(say (f2 20 40))
+(say (f1 (f2 2 1)))
diff --git a/tests/func3.bth b/tests/func3.bth
index 050a9bc..9c0ceeb 100644
--- a/tests/func3.bth
+++ b/tests/func3.bth
@@ -3,5 +3,5 @@
(let (a 3
g (fn (y) (+ y 7)))
(* (g a) (g x)))))
-(puts (f1 6 6))
-(puts (f2 7))
+(say (f1 6 6))
+(say (f2 7))
diff --git a/tests/func4.bth b/tests/func4.bth
index fca67b1..efd2b71 100644
--- a/tests/func4.bth
+++ b/tests/func4.bth
@@ -1,5 +1,5 @@
(set f1 (fn (x) (+ x 10)))
(set f2 (fn (x) (* x 10)))
-(set g (fn (f x) (puts (f x)) (puts (f x))))
+(set g (fn (f x) (say (f x)) (say (f x))))
(g f1 26)
(g f2 6)
diff --git a/tests/mandel.bth b/tests/mandel.bth
index 54a1b4d..e75d694 100644
--- a/tests/mandel.bth
+++ b/tests/mandel.bth
@@ -14,7 +14,7 @@
(set zim nzim)
(set mag (+ (* zre zre) (* zim zim)))
(set i (if (< mag 4) (+ i 1) 999)))
- (print (if (< mag 4) "#" "."))
+ (write (if (< mag 4) "#" "."))
(set pxx (+ pxx 1)))
- (puts "")
+ (say "")
(set pxy (+ pxy 1)))
diff --git a/tests/mandel_local.bth b/tests/mandel_local.bth
index f2a1213..2cfa814 100644
--- a/tests/mandel_local.bth
+++ b/tests/mandel_local.bth
@@ -17,7 +17,7 @@
(set zim nzim)
(set mag (+ (* zre zre) (* zim zim)))
(set i (if (< mag 4) (+ i 1) 999)))
- (print (if (< mag 4) "#" "."))
+ (write (if (< mag 4) "#" "."))
(set pxx (+ pxx 1)))))
- (puts "")
+ (say "")
(set pxy (+ pxy 1))))
diff --git a/tests/multi.bth b/tests/multi.bth
index 49691ce..c2ff8cf 100644
--- a/tests/multi.bth
+++ b/tests/multi.bth
@@ -1,3 +1,3 @@
-(puts "hello")
-(puts "world")
+(say "hello")
+(say "world")
nil
diff --git a/tests/vars.bth b/tests/vars.bth
index 54555ad..423dde6 100644
--- a/tests/vars.bth
+++ b/tests/vars.bth
@@ -1,8 +1,8 @@
(set a 5)
(set b 10)
(set thethe 1234)
-(puts (+ a b))
-(puts (- thethe a))
-(puts (+ (set a 90) b))
-(puts a)
+(say (+ a b))
+(say (- thethe a))
+(say (+ (set a 90) b))
+(say a)
nil
diff --git a/tests/vars1.bth b/tests/vars1.bth
index 7c0e264..24a3f2b 100644
--- a/tests/vars1.bth
+++ b/tests/vars1.bth
@@ -1,2 +1,2 @@
-(puts (+ 2 (let (a 10)
+(say (+ 2 (let (a 10)
(* a a))))
diff --git a/tests/vars2.bth b/tests/vars2.bth
index cc4952e..4e49fb4 100644
--- a/tests/vars2.bth
+++ b/tests/vars2.bth
@@ -1,4 +1,4 @@
-(puts (+ 2 (* 6 (let (a 10
+(say (+ 2 (* 6 (let (a 10
b 20
c 30)
(* b b)))))
diff --git a/tests/vars3.bth b/tests/vars3.bth
index cfc4560..149e694 100644
--- a/tests/vars3.bth
+++ b/tests/vars3.bth
@@ -1,5 +1,5 @@
(set x 1)
(set y 10)
-(puts (let (x 2)
+(say (let (x 2)
(let (y 20)
(+ x y))))
diff --git a/tests/vars4.bth b/tests/vars4.bth
index a535d54..30f75d3 100644
--- a/tests/vars4.bth
+++ b/tests/vars4.bth
@@ -1,7 +1,7 @@
(set x 100)
-(puts x)
+(say x)
(let (x 20)
- (puts x)
+ (say x)
(set x 30)
- (puts x))
-(puts x)
+ (say x))
+(say x)