aboutsummaryrefslogtreecommitdiff
path: root/tests/math/addition
diff options
context:
space:
mode:
Diffstat (limited to 'tests/math/addition')
-rw-r--r--tests/math/addition/bad_arity.neb2
-rw-r--r--tests/math/addition/bad_type_bool.neb2
-rw-r--r--tests/math/addition/bad_type_list.neb2
-rw-r--r--tests/math/addition/bad_type_string.neb2
-rw-r--r--tests/math/addition/bad_type_type.neb2
-rw-r--r--tests/math/addition/happy.neb10
6 files changed, 20 insertions, 0 deletions
diff --git a/tests/math/addition/bad_arity.neb b/tests/math/addition/bad_arity.neb
new file mode 100644
index 0000000..fd4763d
--- /dev/null
+++ b/tests/math/addition/bad_arity.neb
@@ -0,0 +1,2 @@
+(+)
+; panic! [1] '+': expected [1+] arguments, received 0
diff --git a/tests/math/addition/bad_type_bool.neb b/tests/math/addition/bad_type_bool.neb
new file mode 100644
index 0000000..a4bfecc
--- /dev/null
+++ b/tests/math/addition/bad_type_bool.neb
@@ -0,0 +1,2 @@
+(+ 7.34 #true)
+; panic! [1] '+': received :bool, expected :number (got #true)
diff --git a/tests/math/addition/bad_type_list.neb b/tests/math/addition/bad_type_list.neb
new file mode 100644
index 0000000..cb8a999
--- /dev/null
+++ b/tests/math/addition/bad_type_list.neb
@@ -0,0 +1,2 @@
+(+ 4 (list "hello"))
+; panic! [1] '+': received :list, expected :number (got ("hello"))
diff --git a/tests/math/addition/bad_type_string.neb b/tests/math/addition/bad_type_string.neb
new file mode 100644
index 0000000..23a161c
--- /dev/null
+++ b/tests/math/addition/bad_type_string.neb
@@ -0,0 +1,2 @@
+(+ 3 "hello")
+; panic! [1] '+': received :string, expected :number (got "hello")
diff --git a/tests/math/addition/bad_type_type.neb b/tests/math/addition/bad_type_type.neb
new file mode 100644
index 0000000..088fefb
--- /dev/null
+++ b/tests/math/addition/bad_type_type.neb
@@ -0,0 +1,2 @@
+(+ .4 :string)
+; panic! [1] '+': received :type, expected :number (got :string)
diff --git a/tests/math/addition/happy.neb b/tests/math/addition/happy.neb
new file mode 100644
index 0000000..4c037b2
--- /dev/null
+++ b/tests/math/addition/happy.neb
@@ -0,0 +1,10 @@
+(print
+ (concat
+ (->string (+ 2)) " "
+ (->string (+ 4 5)) " "
+ (->string (+ .9)) " "
+ (->string (+ 2.9 4)) " "
+ (->string (+ 2 4.5)) " "
+ (->string (+ 6 7 8 15))))
+
+; 2 9 0.9 6.9 6.5 36