test: fix tests for new maybe api

This commit is contained in:
hellerve 2019-02-13 07:43:34 +01:00
parent e54ead1922
commit 62d08d28ef
3 changed files with 6 additions and 6 deletions

View File

@ -3,16 +3,16 @@
(deftest test
(assert-true test
(nothing? (the (Maybe Int) (Nothing)))
(nothing? &(the (Maybe Int) (Nothing)))
"nothing? works on Nothing")
(assert-false test
(nothing? (Just 1))
(nothing? &(Just 1))
"nothing? works on Just")
(assert-true test
(just? (Just 1))
(just? &(Just 1))
"just? works on Just")
(assert-false test
(just? (the (Maybe Int) (Nothing)))
(just? &(the (Maybe Int) (Nothing)))
"just? works on Nothing")
(assert-equal test
1

View File

@ -23,7 +23,7 @@
(add &(init 3 [2.0 1.0 2.0]) &(init 3 [1.0 2.0 2.5])))
"add operator works")
(assert-true test
(Maybe.nothing? (add &(init 1 [2.0]) &(init 2 [1.0 2.0])))
(Maybe.nothing? &(add &(init 1 [2.0]) &(init 2 [1.0 2.0])))
"add operator works on wrong magnitudes")
(assert-equal test
&(init 3 [1.0 -1.0 -1.5])
@ -31,7 +31,7 @@
(sub &(init 3 [2.0 1.0 2.0]) &(init 3 [1.0 2.0 3.5])))
"sub operator works")
(assert-true test
(Maybe.nothing? (sub &(init 1 [2.0]) &(init 2 [1.0 2.0])))
(Maybe.nothing? &(sub &(init 1 [2.0]) &(init 2 [1.0 2.0])))
"sub operator works on wrong magnitudes")
(assert-equal test
&(init 3 [4.0 2.0 2.2])