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/test/lux/world | |
parent | 62b3abfcc014ca1c19d62aacdd497f6a250b372c (diff) |
Re-named Promise to Async.
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r-- | stdlib/source/test/lux/world/file/watch.lux | 30 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/shell.lux | 4 |
2 files changed, 17 insertions, 17 deletions
diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux index ebb9a374d..cb24e89b7 100644 --- a/stdlib/source/test/lux/world/file/watch.lux +++ b/stdlib/source/test/lux/world/file/watch.lux @@ -9,7 +9,7 @@ ["." try (#+ Try)] ["." exception] [concurrency - ["." promise (#+ Promise)]]] + ["." async (#+ Async)]]] [data ["." binary (#+ Binary) ("#\." equivalence)] ["." text ("#\." equivalence) @@ -71,7 +71,7 @@ [directory (random.ascii/alpha 5) #let [[fs watcher] (/.mock "/")]] ($_ _.and - (wrap (do promise.monad + (wrap (do async.monad [?concern (\ watcher concern directory) ?stop (\ watcher stop directory)] (_.cover' [/.not_being_watched] @@ -90,18 +90,18 @@ ))) (def: (no_events_prior_to_creation! fs watcher directory) - (-> (//.System Promise) (/.Watcher Promise) //.Path (Promise (Try Bit))) - (do {! (try.with promise.monad)} + (-> (//.System Async) (/.Watcher Async) //.Path (Async (Try Bit))) + (do {! (try.with async.monad)} [_ (\ fs make_directory directory) _ (\ watcher start /.all directory)] (|> (\ watcher poll []) (\ ! map list.empty?)))) (def: (after_creation! fs watcher expected_path) - (-> (//.System Promise) (/.Watcher Promise) //.Path (Promise (Try Bit))) - (do (try.with promise.monad) - [_ (: (Promise (Try Any)) - (//.make_file promise.monad fs (binary.create 0) expected_path)) + (-> (//.System Async) (/.Watcher Async) //.Path (Async (Try Bit))) + (do (try.with async.monad) + [_ (: (Async (Try Any)) + (//.make_file async.monad fs (binary.create 0) expected_path)) poll/pre (\ watcher poll []) poll/post (\ watcher poll [])] (wrap (and (case poll/pre @@ -116,9 +116,9 @@ (list.empty? poll/post))))) (def: (after_modification! fs watcher data expected_path) - (-> (//.System Promise) (/.Watcher Promise) Binary //.Path (Promise (Try Bit))) - (do (try.with promise.monad) - [_ (promise.delay 1 (#try.Success "Delay to make sure the over_write time-stamp always changes.")) + (-> (//.System Async) (/.Watcher Async) Binary //.Path (Async (Try Bit))) + (do (try.with async.monad) + [_ (async.delay 1 (#try.Success "Delay to make sure the over_write time-stamp always changes.")) _ (\ fs write data expected_path) poll/2 (\ watcher poll []) poll/2' (\ watcher poll [])] @@ -134,8 +134,8 @@ (list.empty? poll/2'))))) (def: (after_deletion! fs watcher expected_path) - (-> (//.System Promise) (/.Watcher Promise) //.Path (Promise (Try Bit))) - (do (try.with promise.monad) + (-> (//.System Async) (/.Watcher Async) //.Path (Async (Try Bit))) + (do (try.with async.monad) [_ (\ fs delete expected_path) poll/3 (\ watcher poll []) poll/3' (\ watcher poll [])] @@ -164,7 +164,7 @@ expected_path (\ ! map (|>> (format directory /)) (random.ascii/alpha 5)) data ($binary.random 10)] - (wrap (do {! promise.monad} + (wrap (do {! async.monad} [verdict (do (try.with !) [no_events_prior_to_creation! (..no_events_prior_to_creation! fs watcher directory) @@ -187,7 +187,7 @@ [directory (random.ascii/alpha 5) #let [/ "/" [fs watcher] (/.mock /)]] - (wrap (do promise.monad + (wrap (do async.monad [started? ( \ watcher start /.all directory)] (_.cover' [/.cannot_poll_a_non_existent_directory] (case started? diff --git a/stdlib/source/test/lux/world/shell.lux b/stdlib/source/test/lux/world/shell.lux index d86683c5f..1cd1473e8 100644 --- a/stdlib/source/test/lux/world/shell.lux +++ b/stdlib/source/test/lux/world/shell.lux @@ -9,7 +9,7 @@ ["." exception (#+ exception:)] ["." io (#+ IO)] [concurrency - ["." promise (#+ Promise)]] + ["." async (#+ Async)]] [parser ["." environment (#+ Environment)]]] [data @@ -96,7 +96,7 @@ destruction (random.ascii/alpha 5) exit random.int #let [shell (/.async (..io_shell command oops input destruction exit))]] - (wrap (do {! promise.monad} + (wrap (do {! async.monad} [verdict (do (try.with !) [process (\ shell execute [environment.empty "~" command (list)]) read (\ process read []) |