aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/world
diff options
context:
space:
mode:
authorEduardo Julian2020-12-02 04:42:03 -0400
committerEduardo Julian2020-12-02 04:42:03 -0400
commit982a19e0c5d57b53f9726b780fec4c18f0787b4f (patch)
tree50bf995dd5f1361c4a6651e2865819693ea25ca5 /stdlib/source/test/lux/world
parentcfa0a075b89a0df4618e7009f05c157393cbba72 (diff)
Test for Aedifex's "auto" command.
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r--stdlib/source/test/lux/world/file/watch.lux53
1 files changed, 30 insertions, 23 deletions
diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux
index 8d27ab307..5f55825e4 100644
--- a/stdlib/source/test/lux/world/file/watch.lux
+++ b/stdlib/source/test/lux/world/file/watch.lux
@@ -113,39 +113,46 @@
(list.empty? poll/0)]
file (!.use (:: fs create-file) [expected-path])
poll/1 (:: watcher poll [])
+ poll/1' (:: watcher poll [])
#let [after-creation!
- (case poll/1
- (^ (list [actual-path concern]))
- (and (text\= expected-path actual-path)
- (and (/.creation? concern)
- (not (/.modification? concern))
- (not (/.deletion? concern))))
+ (and (case poll/1
+ (^ (list [actual-path concern]))
+ (and (text\= expected-path actual-path)
+ (and (/.creation? concern)
+ (not (/.modification? concern))
+ (not (/.deletion? concern))))
- _
- false)]
+ _
+ false)
+ (list.empty? poll/1'))]
+ _ (promise.delay 1 (#try.Success "Delay to make sure the over-write time-stamp always changes."))
_ (!.use (:: file over-write) data)
poll/2 (:: watcher poll [])
+ poll/2' (:: watcher poll [])
#let [after-modification!
- (case poll/2
- (^ (list [actual-path concern]))
- (and (text\= expected-path actual-path)
- (and (not (/.creation? concern))
- (/.modification? concern)
- (not (/.deletion? concern))))
+ (and (case poll/2
+ (^ (list [actual-path concern]))
+ (and (text\= expected-path actual-path)
+ (and (not (/.creation? concern))
+ (/.modification? concern)
+ (not (/.deletion? concern))))
- _
- false)]
+ _
+ false)
+ (list.empty? poll/2'))]
_ (!.use (:: file delete) [])
poll/3 (:: watcher poll [])
+ poll/3' (:: watcher poll [])
#let [after-deletion!
- (case poll/3
- (^ (list [actual-path concern]))
- (and (not (/.creation? concern))
- (not (/.modification? concern))
- (/.deletion? concern))
+ (and (case poll/3
+ (^ (list [actual-path concern]))
+ (and (not (/.creation? concern))
+ (not (/.modification? concern))
+ (/.deletion? concern))
- _
- false)]]
+ _
+ false)
+ (list.empty? poll/3'))]]
(wrap (and no-events-prior-to-creation!
after-creation!
after-modification!