diff options
author | Eduardo Julian | 2021-09-12 15:39:55 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-12 15:39:55 -0400 |
commit | 2dbbaaec93a53f8dd0b96a0028b9cf125c9066cd (patch) | |
tree | 14bc8b5abe09b46ef005c3ff7cf132f1d98ddf0d /stdlib/source/test/lux/control/concurrency/semaphore.lux | |
parent | dda05bca0956af5e5b3875c4cc36e61aa04772e4 (diff) |
Re-named \ => # && \\ => ##
Diffstat (limited to 'stdlib/source/test/lux/control/concurrency/semaphore.lux')
-rw-r--r-- | stdlib/source/test/lux/control/concurrency/semaphore.lux | 22 |
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)))) |