diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/compile_error.bþ | 1 | ||||
-rw-r--r-- | tests/compile_error.out | 1 | ||||
-rw-r--r-- | tests/fizzbuzz.bþ | 10 | ||||
-rw-r--r-- | tests/fizzbuzz.out | 30 | ||||
-rw-r--r-- | tests/four.bþ | 1 | ||||
-rw-r--r-- | tests/four.out | 1 | ||||
-rw-r--r-- | tests/vars.bþ | 9 | ||||
-rw-r--r-- | tests/vars.out | 5 |
8 files changed, 58 insertions, 0 deletions
diff --git a/tests/compile_error.bþ b/tests/compile_error.bþ new file mode 100644 index 0000000..b151c2f --- /dev/null +++ b/tests/compile_error.bþ @@ -0,0 +1 @@ +(while) diff --git a/tests/compile_error.out b/tests/compile_error.out new file mode 100644 index 0000000..b7b8184 --- /dev/null +++ b/tests/compile_error.out @@ -0,0 +1 @@ +while requires at least 2 arguments diff --git a/tests/fizzbuzz.bþ b/tests/fizzbuzz.bþ new file mode 100644 index 0000000..e70c2c1 --- /dev/null +++ b/tests/fizzbuzz.bþ @@ -0,0 +1,10 @@ +(do + (set n 1) + (while (< n 30) + (print + (if (= 0 (% n 5)) + (if (= 0 (% n 3)) "fizzbuzz" "buzz") + (if (= 0 (% n 3)) "fizz" n))) + (set n (+ n 1)))) + + diff --git a/tests/fizzbuzz.out b/tests/fizzbuzz.out new file mode 100644 index 0000000..51ff50b --- /dev/null +++ b/tests/fizzbuzz.out @@ -0,0 +1,30 @@ +1 +2 +fizz +4 +buzz +fizz +7 +8 +fizz +buzz +11 +fizz +13 +14 +fizzbuzz +16 +17 +fizz +19 +buzz +fizz +22 +23 +fizz +buzz +26 +fizz +28 +29 +nil diff --git a/tests/four.bþ b/tests/four.bþ new file mode 100644 index 0000000..8804fe4 --- /dev/null +++ b/tests/four.bþ @@ -0,0 +1 @@ +(+ 2 2) diff --git a/tests/four.out b/tests/four.out new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/tests/four.out @@ -0,0 +1 @@ +4 diff --git a/tests/vars.bþ b/tests/vars.bþ new file mode 100644 index 0000000..7799acf --- /dev/null +++ b/tests/vars.bþ @@ -0,0 +1,9 @@ +(do + (set a 5) + (set b 10) + (set thethe 1234) + (print (+ a b)) + (print (- thethe a)) + (print (+ (set a 90) b)) + (print a) + nil) diff --git a/tests/vars.out b/tests/vars.out new file mode 100644 index 0000000..bef4ee4 --- /dev/null +++ b/tests/vars.out @@ -0,0 +1,5 @@ +15 +1229 +100 +90 +nil |