diff options
author | Eduardo Julian | 2019-04-04 21:12:25 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-04 21:12:25 -0400 |
commit | 038b220675ab24b59ce4ebf42949b4b4beb2d659 (patch) | |
tree | f5b2205b715e3c7b6ee6c72befa7cac20a91c2b2 /stdlib/source/test | |
parent | 0416ecd9dd79ea8a2d536c11596fc5c60679f6e2 (diff) |
Fixed a bug when pattern matching against "Error" values.
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))))) ))) |