mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +03:00
test: fix tests for new maybe api
This commit is contained in:
parent
e54ead1922
commit
62d08d28ef
@ -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
|
||||
|
0
test/output/examples/sorting.carp.output.actual
Normal file
0
test/output/examples/sorting.carp.output.actual
Normal 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])
|
||||
|
Loading…
Reference in New Issue
Block a user