diff options
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux/data/error.lux | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/stdlib/source/test/lux/data/error.lux b/stdlib/source/test/lux/data/error.lux index 9012b3212..c60c6563a 100644 --- a/stdlib/source/test/lux/data/error.lux +++ b/stdlib/source/test/lux/data/error.lux @@ -32,12 +32,12 @@ (def: #export (error element) (All [a] (-> (Random a) (Random (Error a)))) ($_ r.or - (:: r.monad wrap "KABOOM!") + (r.unicode 1) element)) (def: #export test Test - (<| (_.context (%name (name-of /.Error))) + (<| (_.context (%name (name-of /._))) ($_ _.and ($equivalence.spec (/.equivalence nat.equivalence) (..error r.nat)) ($functor.spec ..injection ..comparison /.functor) @@ -48,17 +48,16 @@ right r.nat #let [expected (n/+ left right) (^open "io@.") io.monad]] - (let [] - (_.test "Can add error functionality to any monad." - (let [lift (/.lift io.monad)] - (|> (do (/.with io.monad) - [a (lift (io@wrap left)) - b (wrap right)] - (wrap (n/+ a b))) - io.run - (case> (#/.Success actual) - (n/= expected actual) + (_.test "Can add error functionality to any monad." + (let [lift (/.lift io.monad)] + (|> (do (/.with io.monad) + [a (lift (io@wrap left)) + b (wrap right)] + (wrap (n/+ a b))) + io.run + (case> (#/.Success actual) + (n/= expected actual) - _ - #0)))))) + _ + false))))) ))) |