aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/command
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/aedifex/command/auto.lux13
-rw-r--r--stdlib/source/test/aedifex/command/build.lux11
-rw-r--r--stdlib/source/test/aedifex/command/deploy.lux99
-rw-r--r--stdlib/source/test/aedifex/command/deps.lux15
-rw-r--r--stdlib/source/test/aedifex/command/install.lux12
-rw-r--r--stdlib/source/test/aedifex/command/test.lux11
6 files changed, 99 insertions, 62 deletions
diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux
index b202af97f..c46b474ac 100644
--- a/stdlib/source/test/aedifex/command/auto.lux
+++ b/stdlib/source/test/aedifex/command/auto.lux
@@ -6,8 +6,6 @@
[control
["[0]" pipe]
["[0]" try]
- [parser
- ["[0]" environment]]
[concurrency
["[0]" atom (.only Atom)]
["[0]" async (.only Async)]]]
@@ -26,8 +24,10 @@
[world
[console (.only Console)]
["[0]" shell (.only Exit Shell)]
- ["[0]" program (.only Program)]
- ["[0]" file
+ ["[0]" environment
+ ["program" / (.only Environment)]
+ ["[1]" \\parser]]
+ ["[0]" file (.only)
["[0]" watch]]
[time
["[0]" instant]]]
@@ -49,7 +49,7 @@
(def (command expected_runs end_signal fs dummy_file)
(-> Nat Text (file.System Async) file.Path
[(Atom Nat)
- (-> (Console Async) (Program Async) (file.System Async) (Shell Async) Resolution (Command [Exit Any]))])
+ (-> (Console Async) (Environment Async) (file.System Async) (Shell Async) Resolution (Command [Exit Any]))])
(let [@runs (is (Atom Nat)
(atom.atom 0))]
[@runs
@@ -71,7 +71,8 @@
.let [/ (at file.default separator)
[fs watcher] (watch.mock /)]
- program (random.alphabetic 5)
+ program (random.and (random.alphabetic 5)
+ (random.alphabetic 5))
target (random.alphabetic 5)
source (random.alphabetic 5)
.let [empty_profile (is Profile
diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux
index c039b6e9c..674a04e93 100644
--- a/stdlib/source/test/aedifex/command/build.lux
+++ b/stdlib/source/test/aedifex/command/build.lux
@@ -9,9 +9,7 @@
["[0]" try]
["[0]" exception]
[concurrency
- ["[0]" async (.only Async)]]
- [parser
- ["[0]" environment]]]
+ ["[0]" async (.only Async)]]]
[data
["[0]" text (.use "[1]#[0]" equivalence)]
[collection
@@ -21,7 +19,9 @@
[world
["[0]" file]
["[0]" shell (.only Shell)]
- ["[0]" program]]
+ ["[0]" environment
+ ["program" /]
+ ["[1]" \\parser]]]
[test
["[0]" unit]
["_" property (.only Test)]]]]
@@ -146,7 +146,8 @@
last_error (random.alphabetic 5)
.let [fs (file.mock (at file.default separator))
shell (shell.async (..good_shell []))]
- program (random.alphabetic 5)
+ program (random.and (random.alphabetic 5)
+ (random.alphabetic 5))
target (random.alphabetic 5)
home (random.alphabetic 5)
working_directory (random.alphabetic 5)
diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux
index 55fac78c6..6e8d38d31 100644
--- a/stdlib/source/test/aedifex/command/deploy.lux
+++ b/stdlib/source/test/aedifex/command/deploy.lux
@@ -2,22 +2,21 @@
[library
[lux (.except)
[abstract
- [monad (.only do)]]
+ ["[0]" monad (.only do)]]
[control
["[0]" maybe]
["[0]" try (.only Try)]
+ ["[0]" exception]
[concurrency
- ["[0]" async (.only Async)]]
- [parser
- ["[0]" environment]]]
+ ["[0]" async (.only Async) (.use "[1]#[0]" monad)]]]
[data
- ["[0]" binary (.use "[1]#[0]" equivalence)]
+ ["[0]" binary (.use "[1]#[0]" equivalence)
+ ["[0]" \\format]]
["[0]" text (.use "[1]#[0]" equivalence)
["%" \\format (.only format)]
[encoding
["[0]" utf8]]]
["[0]" format
- ["[1]" binary]
["[0]" tar]
["[0]" xml]]
[collection
@@ -30,41 +29,74 @@
["[0]" export]]]]
[world
["[0]" file]
- ["[0]" program (.only Program)]
- ["[0]" shell]]
+ ["[0]" shell (.only Process Shell)]
+ ["[0]" environment
+ ["program" / (.only Environment)]
+ ["[1]" \\parser]]]
[test
["[0]" unit]
["_" property (.only Test)]]]]
- [//
- ["$[0]" build]
- ["$[0]" install]
- ["$[0]" version]
+ ["$" //
+ ["[1][0]" install]
+ ["[1][0]" version]
[//
- ["$[0]" profile]
- ["$[0]" repository]]]
+ ["[1][0]" profile]
+ ["[1][0]" repository]]]
[\\program
["[0]" / (.only)
- ["//[1]" ///
- ["[1]" profile]
- ["[1][0]" action]
- ["[1][0]" pom]
- ["[1][0]" hash]
- ["[1][0]" repository (.only Repository)
- ["[1]/[0]" local]
- ["[1]/[0]" remote]]
- ["[1][0]" artifact (.only Artifact)
- ["[1]/[0]" extension]]]]])
+ ["/[1]" //
+ ["[1][0]" install]
+ ["/[1]" //
+ ["[1]" profile]
+ ["[1][0]" action]
+ ["[1][0]" pom]
+ ["[1][0]" hash]
+ ["[1][0]" repository (.only Repository)
+ ["[1]/[0]" local]
+ ["[1]/[0]" remote]]
+ ["[1][0]" artifact (.only Artifact)
+ ["[1]/[0]" extension]]]]]])
+
+(def (shell fs)
+ (-> (file.System Async) (Shell Async))
+ (implementation
+ (def (execute [environment working_directory command arguments])
+ (do [! ///action.monad]
+ [files (at fs directory_files working_directory)
+ _ (monad.each !
+ (function (_ file)
+ (do !
+ [_ (is (Async (Try Any))
+ (file.copy async.monad fs
+ file
+ (format file ".asc")))]
+ (in [])))
+ files)]
+ (<| in
+ (is (Process Async))
+ (implementation
+ (def (read _)
+ (async#in (exception.except shell.no_more_output [])))
+ (def (fail _)
+ (async#in (exception.except shell.no_more_output [])))
+ (def (write input)
+ (async#in {try.#Failure "write"}))
+ (def (destroy _)
+ (async#in {try.#Failure "destroy"}))
+ (def (await _)
+ (in shell.error))))))))
(def (execute! program local remote fs artifact profile)
- (-> (Program Async) (Repository Async) (Repository Async) (file.System Async)
+ (-> (Environment Async) (Repository Async) (Repository Async) (file.System Async)
Artifact ///.Profile
- (Async (Try Text)))
+ (Async (Try [Text Text])))
(do ///action.monad
- [.let [console ($version.echo "")
- shell (shell.async ($build.bad_shell []))]
+ [.let [console ($version.echo "")]
_ ($install.make_sources! fs (the ///.#sources profile))
- _ (/.do! program shell console local remote fs artifact profile)]
- (at console read_line [])))
+ _ (/.do! program (..shell fs) console local remote fs artifact profile)
+ locally_installed! (at console read_line [])
+ deployed! (at console read_line [])]
+ (in [locally_installed! deployed!])))
(def .public test
Test
@@ -87,12 +119,12 @@
$repository.empty)]]
(in (do [! async.monad]
[verdict (do [! ///action.monad]
- [logging (..execute! program local remote fs artifact profile)
+ [[locally_installed! deployed!] (..execute! program local remote fs artifact profile)
expected_library (|> profile
(the ///.#sources)
set.list
(export.library fs)
- (at ! each (format.result tar.format)))
+ (at ! each (\\format.result tar.format)))
actual_pom (at remote download (///repository/remote.uri (the ///artifact.#version artifact) artifact ///artifact/extension.pom))
actual_library (at remote download (///repository/remote.uri (the ///artifact.#version artifact) artifact ///artifact/extension.lux_library))
@@ -108,7 +140,8 @@
(at ///hash.md5_codec decoded actual_md5)))
.let [succeeded!
- (text#= /.success logging)
+ (and (text#= //install.success locally_installed!)
+ (text#= /.success deployed!))
deployed_library!
(binary#= expected_library
diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux
index 15d5e3986..64060127b 100644
--- a/stdlib/source/test/aedifex/command/deps.lux
+++ b/stdlib/source/test/aedifex/command/deps.lux
@@ -2,14 +2,13 @@
[library
[lux (.except)
[abstract
- [monad (.only do)]
- ["[0]" predicate]]
+ [monad (.only do)]]
[control
["[0]" try]
+ [function
+ ["[0]" predicate]]
[concurrency
- ["[0]" async]]
- [parser
- ["[0]" environment]]]
+ ["[0]" async]]]
[data
["[0]" text (.use "[1]#[0]" equivalence)
["%" \\format (.only format)]
@@ -23,8 +22,10 @@
[math
["[0]" random (.only Random)]]
[world
- ["[0]" program]
- ["[0]" file]]
+ ["[0]" file]
+ ["[0]" environment
+ ["program" /]
+ ["[1]" \\parser]]]
[test
["[0]" unit]
["_" property (.only Test)]]]]
diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux
index ff8bca5e9..d942a9d17 100644
--- a/stdlib/source/test/aedifex/command/install.lux
+++ b/stdlib/source/test/aedifex/command/install.lux
@@ -7,9 +7,7 @@
["[0]" try (.only Try) (.use "[1]#[0]" functor)]
["[0]" exception]
[concurrency
- ["[0]" async (.only Async)]]
- [parser
- ["[0]" environment]]]
+ ["[0]" async (.only Async)]]]
[data
["[0]" binary]
["[0]" text (.use "[1]#[0]" equivalence)
@@ -20,7 +18,9 @@
["[0]" random]]
[world
["[0]" file]
- ["[0]" program (.only Program)]]
+ ["[0]" environment
+ ["program" / (.only Environment)]
+ ["[1]" \\parser]]]
[test
["[0]" unit]
["_" property (.only Test)]]]]
@@ -31,7 +31,7 @@
["$[0]" artifact]]]
[\\program
["[0]" / (.only)
- ["/[1]" ///
+ ["//[1]" ///
["[1]" profile]
["[1][0]" action (.only Action)]
["[1][0]" local]
@@ -54,7 +54,7 @@
(file.make_file async.monad fs (binary.empty 0) (format head / head ".lux")))))))))
(def (execute! program fs sample)
- (-> (Program Async) (file.System Async) ///.Profile (Async (Try Text)))
+ (-> (Environment Async) (file.System Async) ///.Profile (Async (Try Text)))
(do ///action.monad
[.let [console ($version.echo "")]
_ (..make_sources! fs (the ///.#sources sample))
diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux
index 1209b4020..31afea06b 100644
--- a/stdlib/source/test/aedifex/command/test.lux
+++ b/stdlib/source/test/aedifex/command/test.lux
@@ -7,9 +7,7 @@
["[0]" try]
["[0]" exception]
[concurrency
- ["[0]" async]]
- [parser
- ["[0]" environment]]]
+ ["[0]" async]]]
[data
["[0]" text (.use "[1]#[0]" equivalence)]
[collection
@@ -20,7 +18,9 @@
[world
["[0]" file]
["[0]" shell]
- ["[0]" program]]
+ ["[0]" environment
+ ["program" /]
+ ["[1]" \\parser]]]
[test
["[0]" unit]
["_" property (.only Test)]]]]
@@ -45,7 +45,8 @@
Test
(<| (_.covering /._)
(do [! random.monad]
- [test (random.alphabetic 5)
+ [test (random.and (random.alphabetic 5)
+ (random.alphabetic 5))
target (random.alphabetic 5)
home (random.alphabetic 5)
working_directory (random.alphabetic 5)