diff options
Diffstat (limited to 'stdlib/source/test/lux/control/concurrency/promise.lux')
-rw-r--r-- | stdlib/source/test/lux/control/concurrency/promise.lux | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/stdlib/source/test/lux/control/concurrency/promise.lux b/stdlib/source/test/lux/control/concurrency/promise.lux index 0dc28819d..852dca607 100644 --- a/stdlib/source/test/lux/control/concurrency/promise.lux +++ b/stdlib/source/test/lux/control/concurrency/promise.lux @@ -68,97 +68,97 @@ (/.promise []))] resolved? (/.future (resolver expected)) actual promise] - (_.claim [/.Promise /.Resolver /.promise] - (and resolved? - (n.= expected actual))))) + (_.cover' [/.Promise /.Resolver /.promise] + (and resolved? + (n.= expected actual))))) (wrap (do /.monad [actual (/.resolved expected)] - (_.claim [/.resolved] - (n.= expected actual)))) + (_.cover' [/.resolved] + (n.= expected actual)))) (wrap (do /.monad [actual (/.future (io.io expected))] - (_.claim [/.future] - (n.= expected actual)))) + (_.cover' [/.future] + (n.= expected actual)))) (wrap (do /.monad [pre (/.future instant.now) actual (/.schedule to-wait (io.io expected)) post (/.future instant.now)] - (_.claim [/.schedule] - (and (n.= expected actual) - (i.>= (.int to-wait) - (duration.to-millis (instant.span pre post))))))) + (_.cover' [/.schedule] + (and (n.= expected actual) + (i.>= (.int to-wait) + (duration.to-millis (instant.span pre post))))))) (wrap (do /.monad [pre (/.future instant.now) _ (/.wait to-wait) post (/.future instant.now)] - (_.claim [/.wait] - (i.>= (.int to-wait) - (duration.to-millis (instant.span pre post)))))) + (_.cover' [/.wait] + (i.>= (.int to-wait) + (duration.to-millis (instant.span pre post)))))) (wrap (do /.monad [[leftA rightA] (/.and (/.future (io.io leftE)) (/.future (io.io rightE)))] - (_.claim [/.and] - (n.= (n.+ leftE rightE) - (n.+ leftA rightA))))) + (_.cover' [/.and] + (n.= (n.+ leftE rightE) + (n.+ leftA rightA))))) (wrap (do /.monad [pre (/.future instant.now) actual (/.delay to-wait expected) post (/.future instant.now)] - (_.claim [/.delay] - (and (n.= expected actual) - (i.>= (.int to-wait) - (duration.to-millis (instant.span pre post))))))) + (_.cover' [/.delay] + (and (n.= expected actual) + (i.>= (.int to-wait) + (duration.to-millis (instant.span pre post))))))) (wrap (do /.monad [?left (/.or (/.delay 100 leftE) (/.delay 200 dummy)) ?right (/.or (/.delay 200 dummy) (/.delay 100 rightE))] - (_.claim [/.or] - (case [?left ?right] - [(#.Left leftA) (#.Right rightA)] - (n.= (n.+ leftE rightE) - (n.+ leftA rightA)) + (_.cover' [/.or] + (case [?left ?right] + [(#.Left leftA) (#.Right rightA)] + (n.= (n.+ leftE rightE) + (n.+ leftA rightA)) - _ - false)))) + _ + false)))) (wrap (do /.monad [leftA (/.either (/.delay 100 leftE) (/.delay 200 dummy)) rightA (/.either (/.delay 200 dummy) (/.delay 100 rightE))] - (_.claim [/.either] - (n.= (n.+ leftE rightE) - (n.+ leftA rightA))))) + (_.cover' [/.either] + (n.= (n.+ leftE rightE) + (n.+ leftA rightA))))) (wrap (do /.monad [?actual (/.future (/.poll (/.resolved expected))) #let [[promise resolver] (: [(/.Promise Nat) (/.Resolver Nat)] (/.promise []))] ?never (/.future (/.poll promise))] - (_.claim [/.poll] - (case [?actual ?never] - [(#.Some actual) #.None] - (n.= expected actual) + (_.cover' [/.poll] + (case [?actual ?never] + [(#.Some actual) #.None] + (n.= expected actual) - _ - false)))) + _ + false)))) (wrap (do /.monad [yep (/.future (/.resolved? (/.resolved expected))) #let [[promise resolver] (: [(/.Promise Nat) (/.Resolver Nat)] (/.promise []))] nope (/.future (/.resolved? promise))] - (_.claim [/.resolved?] - (and yep - (not nope))))) + (_.cover' [/.resolved?] + (and yep + (not nope))))) (wrap (do /.monad [?none (/.time-out to-wait (/.delay extra-time dummy)) ?actual (/.time-out extra-time (/.delay to-wait expected))] - (_.claim [/.time-out] - (case [?none ?actual] - [#.None (#.Some actual)] - (n.= expected actual) + (_.cover' [/.time-out] + (case [?none ?actual] + [#.None (#.Some actual)] + (n.= expected actual) - _ - false)))) + _ + false)))) (wrap (do /.monad [#let [box (: (Atom Nat) (atom.atom dummy))] @@ -166,6 +166,6 @@ (atom.write value box)) (/.resolved expected))) actual (/.future (atom.read box))] - (_.claim [/.await] - (n.= expected actual)))) + (_.cover' [/.await] + (n.= expected actual)))) )))) |