diff options
Diffstat (limited to 'stdlib/test/test/lux/concurrency/actor.lux')
-rw-r--r-- | stdlib/test/test/lux/concurrency/actor.lux | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/stdlib/test/test/lux/concurrency/actor.lux b/stdlib/test/test/lux/concurrency/actor.lux index a92c2c376..a8f6ed7fb 100644 --- a/stdlib/test/test/lux/concurrency/actor.lux +++ b/stdlib/test/test/lux/concurrency/actor.lux @@ -20,7 +20,7 @@ (stop: (wrap []))) -(test: "Actors" +(context: "Actors" (let [counter-proc (: (&;Behavior Int (Promise Int)) [(function [self output state] (let [state' (i.inc state)] @@ -28,22 +28,22 @@ (Promise/wrap (#;Right state'))))) (function [?error state] (Promise/wrap []))])] ($_ seq - (assert "Can check where an actor is alive." - (let [counter (: (&;Actor Int (Promise Int)) - (io;run (&;spawn 0 counter-proc)))] - (&;alive? counter))) + (test "Can check where an actor is alive." + (let [counter (: (&;Actor Int (Promise Int)) + (io;run (&;spawn 0 counter-proc)))] + (&;alive? counter))) - (assert "Can poison/kill actors." - (let [counter (: (&;Actor Int (Promise Int)) - (io;run (&;spawn 0 counter-proc)))] - (and (io;run (&;poison counter)) - (not (&;alive? counter))))) + (test "Can poison/kill actors." + (let [counter (: (&;Actor Int (Promise Int)) + (io;run (&;spawn 0 counter-proc)))] + (and (io;run (&;poison counter)) + (not (&;alive? counter))))) - (assert "Can't poison an already poisoned actor." - (let [counter (: (&;Actor Int (Promise Int)) - (io;run (&;spawn 0 counter-proc)))] - (and (io;run (&;poison counter)) - (not (io;run (&;poison counter)))))) + (test "Can't poison an already poisoned actor." + (let [counter (: (&;Actor Int (Promise Int)) + (io;run (&;spawn 0 counter-proc)))] + (and (io;run (&;poison counter)) + (not (io;run (&;poison counter)))))) (do Monad<Promise> [#let [counter (: (&;Actor Int (Promise Int)) @@ -57,10 +57,10 @@ =1 output-1 =2 output-2 =3 output-3] - (assert "Can send messages to actors." - (and (i.= 1 =1) - (i.= 2 =2) - (i.= 3 =3)))) + (test "Can send messages to actors." + (and (i.= 1 =1) + (i.= 2 =2) + (i.= 3 =3)))) (do Monad<Promise> [#let [adder (: Adder @@ -69,11 +69,11 @@ t2 (add! 2 adder) t3 (add! 3 adder) #let [_ (io;run (&;poison adder))]] - (assert "Can use custom-defined actors." - (case [t1 t2 t3] - [[0 1] [1 3] [3 6]] - true + (test "Can use custom-defined actors." + (case [t1 t2 t3] + [[0 1] [1 3] [3 6]] + true - _ - false))) + _ + false))) ))) |