From e169e50e9d2ab5584e3b72ed069e7695a123e1e7 Mon Sep 17 00:00:00 2001 From: mryouse Date: Sun, 3 Jul 2022 01:00:18 +0000 Subject: initial commit of tests for math things --- tests/math/floor/bad_arity_two.neb | 2 ++ tests/math/floor/bad_arity_zero.neb | 2 ++ tests/math/floor/bad_type_bool.neb | 2 ++ tests/math/floor/bad_type_list.neb | 2 ++ tests/math/floor/bad_type_string.neb | 2 ++ tests/math/floor/bad_type_type.neb | 2 ++ tests/math/floor/happy.neb | 7 +++++++ 7 files changed, 19 insertions(+) create mode 100644 tests/math/floor/bad_arity_two.neb create mode 100644 tests/math/floor/bad_arity_zero.neb create mode 100644 tests/math/floor/bad_type_bool.neb create mode 100644 tests/math/floor/bad_type_list.neb create mode 100644 tests/math/floor/bad_type_string.neb create mode 100644 tests/math/floor/bad_type_type.neb create mode 100644 tests/math/floor/happy.neb (limited to 'tests/math/floor') diff --git a/tests/math/floor/bad_arity_two.neb b/tests/math/floor/bad_arity_two.neb new file mode 100644 index 0000000..2968901 --- /dev/null +++ b/tests/math/floor/bad_arity_two.neb @@ -0,0 +1,2 @@ +(floor 20 4) +; panic! [1] 'floor': expected [1] arguments, received 2 diff --git a/tests/math/floor/bad_arity_zero.neb b/tests/math/floor/bad_arity_zero.neb new file mode 100644 index 0000000..cc21ccc --- /dev/null +++ b/tests/math/floor/bad_arity_zero.neb @@ -0,0 +1,2 @@ +(floor) +; panic! [1] 'floor': expected [1] arguments, received 0 diff --git a/tests/math/floor/bad_type_bool.neb b/tests/math/floor/bad_type_bool.neb new file mode 100644 index 0000000..4404bfc --- /dev/null +++ b/tests/math/floor/bad_type_bool.neb @@ -0,0 +1,2 @@ +(floor #true) +; panic! [1] 'floor': received :bool, expected :number (got #true) diff --git a/tests/math/floor/bad_type_list.neb b/tests/math/floor/bad_type_list.neb new file mode 100644 index 0000000..a0d3b3b --- /dev/null +++ b/tests/math/floor/bad_type_list.neb @@ -0,0 +1,2 @@ +(floor (list "hello")) +; panic! [1] 'floor': received :list, expected :number (got ("hello")) diff --git a/tests/math/floor/bad_type_string.neb b/tests/math/floor/bad_type_string.neb new file mode 100644 index 0000000..c1abd33 --- /dev/null +++ b/tests/math/floor/bad_type_string.neb @@ -0,0 +1,2 @@ +(floor "hello") +; panic! [1] 'floor': received :string, expected :number (got "hello") diff --git a/tests/math/floor/bad_type_type.neb b/tests/math/floor/bad_type_type.neb new file mode 100644 index 0000000..d5383cf --- /dev/null +++ b/tests/math/floor/bad_type_type.neb @@ -0,0 +1,2 @@ +(floor :string) +; panic! [1] 'floor': received :type, expected :number (got :string) diff --git a/tests/math/floor/happy.neb b/tests/math/floor/happy.neb new file mode 100644 index 0000000..7fda23e --- /dev/null +++ b/tests/math/floor/happy.neb @@ -0,0 +1,7 @@ +(print + (concat + (->string (floor 5)) " " + (->string (floor 3.6)) " " + (->string (floor 2.5)))) + +; 5 3 2 -- cgit v1.2.3