aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/world/file/watch.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/world/file/watch.lux')
-rw-r--r--stdlib/source/test/lux/world/file/watch.lux30
1 files changed, 15 insertions, 15 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?