aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/command/clean.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-12-03 02:09:57 -0400
committerEduardo Julian2020-12-03 02:09:57 -0400
commit0205e5146b50ab066d152fccda0fc8cef4eef852 (patch)
treeda2d89132da8f09344e26db78d0e43ca1095ee7f /stdlib/source/test/aedifex/command/clean.lux
parent28c724857d76afdc40b5b036f415cc151eb66263 (diff)
Detect duplicate files coming from dependencies.
Diffstat (limited to 'stdlib/source/test/aedifex/command/clean.lux')
-rw-r--r--stdlib/source/test/aedifex/command/clean.lux65
1 files changed, 40 insertions, 25 deletions
diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux
index 11570d034..739bd1a34 100644
--- a/stdlib/source/test/aedifex/command/clean.lux
+++ b/stdlib/source/test/aedifex/command/clean.lux
@@ -12,7 +12,7 @@
[data
[binary (#+ Binary)]
["." product]
- ["." text
+ ["." text ("#\." equivalence)
["%" format (#+ format)]]
[number
["n" nat]]
@@ -23,12 +23,14 @@
["." random (#+ Random)]]
[world
["." file (#+ Path File)]]]
- [///
- ["@." profile]
+ [//
+ ["@." version]
[//
- [lux
- [data
- ["_." binary]]]]]
+ ["@." profile]
+ [//
+ [lux
+ [data
+ ["_." binary]]]]]]
{#program
["." /
["//#" /// #_
@@ -97,22 +99,35 @@
sub-files (..files (format sub-path /))
dummy @profile.random]
- (wrap (do promise.monad
- [verdict (do {! (try.with promise.monad)}
- [_ (..create-directory! fs target-path direct-files)
- _ (..create-directory! fs sub-path sub-files)
- context-exists!/pre (..directory-exists? fs context)
- target-exists!/pre (..assets-exist? fs target-path direct-files)
- sub-exists!/pre (..assets-exist? fs sub-path sub-files)
- _ (/.do! fs (set@ #///.target (#.Some target-path) dummy))
- context-exists!/post (..directory-exists? fs context)
- target-exists!/post (..assets-exist? fs target-path direct-files)
- sub-exists!/post (..assets-exist? fs sub-path sub-files)]
- (wrap (and (and context-exists!/pre
- context-exists!/post)
- (and target-exists!/pre
- (not target-exists!/post))
- (and sub-exists!/pre
- (not sub-exists!/post)))))]
- (_.cover' [/.do!]
- (try.default false verdict)))))))
+ ($_ _.and
+ (wrap (do promise.monad
+ [#let [console (@version.echo "")]
+ verdict (do {! (try.with promise.monad)}
+ [_ (/.do! console fs (set@ #///.target #.None dummy))]
+ (\ ! map (text\= /.failure)
+ (!.use (\ console read-line) [])))]
+ (_.cover' [/.failure]
+ (try.default false verdict))))
+ (wrap (do promise.monad
+ [#let [console (@version.echo "")]
+ verdict (do {! (try.with promise.monad)}
+ [_ (..create-directory! fs target-path direct-files)
+ _ (..create-directory! fs sub-path sub-files)
+ context-exists!/pre (..directory-exists? fs context)
+ target-exists!/pre (..assets-exist? fs target-path direct-files)
+ sub-exists!/pre (..assets-exist? fs sub-path sub-files)
+ _ (/.do! console fs (set@ #///.target (#.Some target-path) dummy))
+ context-exists!/post (..directory-exists? fs context)
+ target-exists!/post (..assets-exist? fs target-path direct-files)
+ sub-exists!/post (..assets-exist? fs sub-path sub-files)
+ logging (!.use (\ console read-line) [])]
+ (wrap (and (and context-exists!/pre
+ context-exists!/post)
+ (and target-exists!/pre
+ (not target-exists!/post))
+ (and sub-exists!/pre
+ (not sub-exists!/post))
+ (text\= /.success logging))))]
+ (_.cover' [/.do! /.success]
+ (try.default false verdict))))
+ ))))