diff options
author | Eduardo Julian | 2021-07-26 01:45:57 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-26 01:45:57 -0400 |
commit | e64b6d0114c26a455e19a416b5f02a4d19dd711f (patch) | |
tree | 020e426a40aefebf6b052e799b33c40fe4d8a80c /stdlib/source/specification/lux/world/shell.lux | |
parent | 62b3abfcc014ca1c19d62aacdd497f6a250b372c (diff) |
Re-named Promise to Async.
Diffstat (limited to 'stdlib/source/specification/lux/world/shell.lux')
-rw-r--r-- | stdlib/source/specification/lux/world/shell.lux | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/specification/lux/world/shell.lux b/stdlib/source/specification/lux/world/shell.lux index c4fc51b99..55197a307 100644 --- a/stdlib/source/specification/lux/world/shell.lux +++ b/stdlib/source/specification/lux/world/shell.lux @@ -7,7 +7,7 @@ [control ["." try ("#\." functor)] [concurrency - ["." promise (#+ Promise) ("#\." monad)]] + ["." async (#+ Async) ("#\." monad)]] [parser ["." environment (#+ Environment)]]] [data @@ -34,22 +34,22 @@ ) (def: (can_wait! process) - (-> (/.Process Promise) _.Assertion) + (-> (/.Process Async) _.Assertion) (|> (\ process await []) - (promise\map (|>> (try\map (i.= /.normal)) - (try.default false) - (_.cover' [/.Exit /.normal]))) - promise\join)) + (async\map (|>> (try\map (i.= /.normal)) + (try.default false) + (_.cover' [/.Exit /.normal]))) + async\join)) (def: (can_read! expected process) - (-> Text (/.Process Promise) (Promise Bit)) + (-> Text (/.Process Async) (Async Bit)) (|> (\ process read []) - (promise\map (|>> (try\map (text\= expected)) - (try.default false))))) + (async\map (|>> (try\map (text\= expected)) + (try.default false))))) (def: (can_destroy! process) - (-> (/.Process Promise) (Promise Bit)) - (do promise.monad + (-> (/.Process Async) (Async Bit)) + (do async.monad [?destroy (\ process destroy []) ?await (\ process await [])] (wrap (and (case ?destroy @@ -67,12 +67,12 @@ (with_expansions [<shell_coverage> (as_is [/.Command /.Argument])] (def: #export (spec shell) - (-> (/.Shell Promise) Test) + (-> (/.Shell Async) Test) (<| (_.for [/.Shell /.Process]) (do {! random.monad} [message (random.ascii/alpha 10) seconds (\ ! map (|>> (n.% 5) (n.+ 5)) random.nat)] - (wrap (do {! promise.monad} + (wrap (do {! async.monad} [?echo (\ shell execute (..echo! message)) ?sleep (\ shell execute (..sleep! seconds))] (case [?echo ?sleep] |