diff options
Diffstat (limited to 'stdlib/test/test/lux/control/reader.lux')
-rw-r--r-- | stdlib/test/test/lux/control/reader.lux | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/stdlib/test/test/lux/control/reader.lux b/stdlib/test/test/lux/control/reader.lux index 85b5edf8b..f7aa8630f 100644 --- a/stdlib/test/test/lux/control/reader.lux +++ b/stdlib/test/test/lux/control/reader.lux @@ -9,29 +9,29 @@ [number])) lux/test) -(test: "Readers" +(context: "Readers" ($_ seq - (assert "" (i.= 123 (&;run 123 &;ask))) - (assert "" (i.= 246 (&;run 123 (&;local (i.* 2) &;ask)))) - (assert "" (i.= 134 (&;run 123 (:: &;Functor<Reader> map i.inc (i.+ 10))))) - (assert "" (i.= 10 (&;run 123 (:: &;Applicative<Reader> wrap 10)))) - (assert "" (i.= 30 (&;run 123 (let [(^open "&/") &;Applicative<Reader>] - (&/apply (&/wrap (i.+ 10)) (&/wrap 20)))))) - (assert "" (i.= 30 (&;run 123 (do &;Monad<Reader> - [f (wrap i.+) - x (wrap 10) - y (wrap 20)] - (wrap (f x y)))))))) + (test "" (i.= 123 (&;run 123 &;ask))) + (test "" (i.= 246 (&;run 123 (&;local (i.* 2) &;ask)))) + (test "" (i.= 134 (&;run 123 (:: &;Functor<Reader> map i.inc (i.+ 10))))) + (test "" (i.= 10 (&;run 123 (:: &;Applicative<Reader> wrap 10)))) + (test "" (i.= 30 (&;run 123 (let [(^open "&/") &;Applicative<Reader>] + (&/apply (&/wrap (i.+ 10)) (&/wrap 20)))))) + (test "" (i.= 30 (&;run 123 (do &;Monad<Reader> + [f (wrap i.+) + x (wrap 10) + y (wrap 20)] + (wrap (f x y)))))))) -(test: "Monad transformer" +(context: "Monad transformer" (let [(^open "io/") io;Monad<IO>] - (assert "Can add reader functionality to any monad." - (|> (do (&;ReaderT io;Monad<IO>) - [a (&;lift-reader (io/wrap 123)) - b (wrap 456)] - (wrap (i.+ a b))) - (&;run "") - io;run - (case> 579 true - _ false))) + (test "Can add reader functionality to any monad." + (|> (do (&;ReaderT io;Monad<IO>) + [a (&;lift-reader (io/wrap 123)) + b (wrap 456)] + (wrap (i.+ a b))) + (&;run "") + io;run + (case> 579 true + _ false))) )) |