diff options
Diffstat (limited to 'stdlib/source/test/lux/control/concurrency/actor.lux')
-rw-r--r-- | stdlib/source/test/lux/control/concurrency/actor.lux | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux index 5f96bbe35..73ff15702 100644 --- a/stdlib/source/test/lux/control/concurrency/actor.lux +++ b/stdlib/source/test/lux/control/concurrency/actor.lux @@ -49,12 +49,12 @@ Test (do [! random.monad] [initial_state random.nat - .let [as_mail (: (All (_ a) (-> (-> a a) (/.Mail a))) - (function (_ transform) - (function (_ state actor) - (|> state transform {try.#Success} async#in)))) - ++! (: (/.Mail Nat) (as_mail ++)) - --! (: (/.Mail Nat) (as_mail --))]] + .let [as_mail (is (All (_ a) (-> (-> a a) (/.Mail a))) + (function (_ transform) + (function (_ state actor) + (|> state transform {try.#Success} async#in)))) + ++! (is (/.Mail Nat) (as_mail ++)) + --! (is (/.Mail Nat) (as_mail --))]] (<| (_.covering /._) (_.for [/.Actor]) ($_ _.and @@ -82,23 +82,23 @@ (and poisoned_actors_die! cannot_poison_more_than_once!))) - (let [[read write] (: [(Async Text) (Resolver Text)] - (async.async []))] + (let [[read write] (is [(Async Text) (Resolver Text)] + (async.async []))] (in (do async.monad [_ (async.future (do io.monad - [actor (/.spawn! (: (/.Behavior Any Any) - [/.#on_init (|>>) - /.#on_mail (function (_ message state self) - (do [! async.monad] - [outcome (message state self)] - (case outcome - {try.#Failure cause} - (do ! - [_ (async.future (write cause))] - (in outcome)) - - {try.#Success _} - (in outcome))))]) + [actor (/.spawn! (is (/.Behavior Any Any) + [/.#on_init (|>>) + /.#on_mail (function (_ message state self) + (do [! async.monad] + [outcome (message state self)] + (case outcome + {try.#Failure cause} + (do ! + [_ (async.future (write cause))] + (in outcome)) + + {try.#Success _} + (in outcome))))]) [])] (/.poison! actor))) _ (async.delay 100) @@ -133,9 +133,9 @@ {try.#Failure error} (exception.match? /.dead error))))) - (let [die! (: (/.Mail Nat) - (function (_ state actor) - (async#in (exception.except ..got_wrecked []))))] + (let [die! (is (/.Mail Nat) + (function (_ state actor) + (async#in (exception.except ..got_wrecked []))))] (in (do async.monad [result (async.future (do io.monad [actor (/.spawn! /.default initial_state) @@ -202,8 +202,8 @@ events (random.list num_events random.nat) num_observations (# ! each (n.% num_events) random.nat) .let [expected (list.first num_observations events) - sink (: (Atom (Sequence Nat)) - (atom.atom sequence.empty))]] + sink (is (Atom (Sequence Nat)) + (atom.atom sequence.empty))]] (in (do async.monad [agent (async.future (do [! io.monad] |