diff options
Diffstat (limited to 'stdlib/source/test/lux/control/concurrency/semaphore.lux')
| -rw-r--r-- | stdlib/source/test/lux/control/concurrency/semaphore.lux | 17 | 
1 files changed, 9 insertions, 8 deletions
diff --git a/stdlib/source/test/lux/control/concurrency/semaphore.lux b/stdlib/source/test/lux/control/concurrency/semaphore.lux index ac4bd63b3..5254ce02f 100644 --- a/stdlib/source/test/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/test/lux/control/concurrency/semaphore.lux @@ -1,7 +1,6 @@  (.require   [library    [lux (.except) -   ["_" test (.only Test)]     [abstract      ["[0]" monad (.only do)]      ["[0]" enum]] @@ -26,7 +25,9 @@     [meta      ["@" target]      [type -     ["[0]" refinement]]]]] +     ["[0]" refinement]]] +   ["_" test (.only Test) +    ["[0]" unit]]]]   [\\library    ["[0]" /]]) @@ -43,7 +44,7 @@                   .let [semaphore (/.semaphore initial_open_positions)]]                  (in (do async.monad                        [result (async.within ..delay (/.wait! semaphore))] -                      (_.coverage' [/.semaphore] +                      (unit.coverage [/.semaphore]                          (case result                            {.#Some _}                            true @@ -56,7 +57,7 @@                  (in (do [! async.monad]                        [_ (monad.each ! /.wait! (list.repeated initial_open_positions semaphore))                         result (async.within ..delay (/.wait! semaphore))] -                      (_.coverage' [/.wait!] +                      (unit.coverage [/.wait!]                          (case result                            {.#Some _}                            false @@ -72,7 +73,7 @@                         result/0 (async.within ..delay block)                         open_positions (/.signal! semaphore)                         result/1 (async.within ..delay block)] -                      (_.coverage' [/.signal!] +                      (unit.coverage [/.signal!]                          (case [result/0 result/1 open_positions]                            [{.#None} {.#Some _} {try.#Success +0}]                            true @@ -84,7 +85,7 @@                   .let [semaphore (/.semaphore initial_open_positions)]]                  (in (do async.monad                        [outcome (/.signal! semaphore)] -                      (_.coverage' [/.semaphore_is_maxed_out] +                      (unit.coverage [/.semaphore_is_maxed_out]                          (case outcome                            {try.#Failure error}                            (exception.match? /.semaphore_is_maxed_out error) @@ -123,7 +124,7 @@                        [_ processA                         _ processB                         .let [outcome (io.run! (atom.read! resource))]] -                      (_.coverage' [/.mutex /.synchronize!] +                      (unit.coverage [/.mutex /.synchronize!]                          (or (text#= (format expected_As expected_Bs)                                      outcome)                              (text#= (format expected_Bs expected_As) @@ -171,7 +172,7 @@                                              (waiter resource barrier id))))                               (monad.all !))                         .let [outcome (io.run! (atom.read! resource))]] -                      (_.coverage' [/.barrier /.block!] +                      (unit.coverage [/.barrier /.block!]                          (and (text.ends_with? expected_ending outcome)                               (list.every? (function (_ id)                                              (text.contains? (%.nat id) outcome))  | 
