aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/control/concurrency/semaphore.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/control/concurrency/semaphore.lux')
-rw-r--r--stdlib/source/test/lux/control/concurrency/semaphore.lux22
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/test/lux/control/concurrency/semaphore.lux b/stdlib/source/test/lux/control/concurrency/semaphore.lux
index da3c90bae..e3f49842a 100644
--- a/stdlib/source/test/lux/control/concurrency/semaphore.lux
+++ b/stdlib/source/test/lux/control/concurrency/semaphore.lux
@@ -15,10 +15,10 @@
["[0]" async {"+" [Async]}]
["[0]" atom {"+" [Atom]}]]]
[data
- ["[0]" text ("[1]\[0]" equivalence)
+ ["[0]" text ("[1]#[0]" equivalence)
["%" format {"+" [format]}]]
[collection
- ["[0]" list ("[1]\[0]" functor)]]]
+ ["[0]" list ("[1]#[0]" functor)]]]
[math
["[0]" random]
[number
@@ -39,7 +39,7 @@
(_.for [/.Semaphore]
($_ _.and
(do [! random.monad]
- [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1))))
+ [initial_open_positions (|> random.nat (# ! each (|>> (n.% 10) (n.max 1))))
.let [semaphore (/.semaphore initial_open_positions)]]
(in (do async.monad
[result (async.within ..delay (/.wait! semaphore))]
@@ -51,7 +51,7 @@
{.#None}
false)))))
(do [! random.monad]
- [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1))))
+ [initial_open_positions (|> random.nat (# ! each (|>> (n.% 10) (n.max 1))))
.let [semaphore (/.semaphore initial_open_positions)]]
(in (do [! async.monad]
[_ (monad.each ! /.wait! (list.repeated initial_open_positions semaphore))
@@ -64,7 +64,7 @@
{.#None}
true)))))
(do [! random.monad]
- [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1))))
+ [initial_open_positions (|> random.nat (# ! each (|>> (n.% 10) (n.max 1))))
.let [semaphore (/.semaphore initial_open_positions)]]
(in (do [! async.monad]
[_ (monad.each ! /.wait! (list.repeated initial_open_positions semaphore))
@@ -80,7 +80,7 @@
_
false)))))
(do [! random.monad]
- [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1))))
+ [initial_open_positions (|> random.nat (# ! each (|>> (n.% 10) (n.max 1))))
.let [semaphore (/.semaphore initial_open_positions)]]
(in (do async.monad
[outcome (/.signal! semaphore)]
@@ -98,7 +98,7 @@
(_.for [/.Mutex]
($_ _.and
(do [! random.monad]
- [repetitions (|> random.nat (\ ! each (|>> (n.% 100) (n.max 10))))
+ [repetitions (|> random.nat (# ! each (|>> (n.% 100) (n.max 10))))
.let [resource (atom.atom "")
expected_As (text.together (list.repeated repetitions "A"))
expected_Bs (text.together (list.repeated repetitions "B"))
@@ -124,9 +124,9 @@
_ processB
.let [outcome (io.run! (atom.read! resource))]]
(_.cover' [/.mutex /.synchronize!]
- (or (text\= (format expected_As expected_Bs)
+ (or (text#= (format expected_As expected_Bs)
outcome)
- (text\= (format expected_Bs expected_As)
+ (text#= (format expected_Bs expected_As)
outcome))))))
)))
@@ -155,7 +155,7 @@
_
false)))
(do [! random.monad]
- [limit (\ ! each (|>> (n.% 9) ++) random.nat)
+ [limit (# ! each (|>> (n.% 9) ++) random.nat)
.let [barrier (/.barrier (maybe.trusted (/.limit limit)))
resource (atom.atom "")]]
(in (do [! async.monad]
@@ -165,7 +165,7 @@
text.together)
expected_ids (enum.range n.enum 0 (-- limit))]
_ (|> expected_ids
- (list\each (function (_ id)
+ (list#each (function (_ id)
(exec
(io.run! (atom.update! (|>> (format suffix)) resource))
(waiter resource barrier id))))