aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/command
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/aedifex/command')
-rw-r--r--stdlib/source/test/aedifex/command/auto.lux17
-rw-r--r--stdlib/source/test/aedifex/command/build.lux32
-rw-r--r--stdlib/source/test/aedifex/command/test.lux13
3 files changed, 24 insertions, 38 deletions
diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux
index e8f6d17f1..48b2a7eb3 100644
--- a/stdlib/source/test/aedifex/command/auto.lux
+++ b/stdlib/source/test/aedifex/command/auto.lux
@@ -26,6 +26,7 @@
[world
[console (#+ Console)]
["." shell (#+ Shell)]
+ ["." program (#+ Program)]
["." file (#+ Path)
["." watch]]]]
["." // #_
@@ -49,11 +50,11 @@
(def: (command end-signal dummy-files)
(-> Text (List Path)
[(Atom [Nat (List Path)])
- (-> (Console Promise) Environment (file.System Promise) (Shell Promise) Resolution (Command Any))])
+ (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command Any))])
(let [@runs (: (Atom [Nat (List Path)])
(atom.atom [0 dummy-files]))]
[@runs
- (function (_ console environment fs shell resolution profile)
+ (function (_ console program fs shell resolution profile)
(do {! promise.monad}
[[runs remaining-files] (promise.future
(atom.update (function (_ [runs remaining-files])
@@ -95,9 +96,7 @@
profile (|> empty-profile
with-program
with-target
- (set@ #///.sources (set.from-list text.hash (list source))))
-
- environment (dictionary.put "user.dir" working-directory environment.empty)]
+ (set@ #///.sources (set.from-list text.hash (list source))))]
resolution @build.resolution]
($_ _.and
(wrap (do promise.monad
@@ -106,7 +105,13 @@
_ (!.use (\ fs create-directory) [source])
_ (\ watcher poll [])]
(do promise.monad
- [outcome ((/.do! watcher command) (@version.echo "") environment fs (@build.good-shell []) resolution profile)
+ [outcome ((/.do! watcher command)
+ (@version.echo "")
+ (program.async (program.mock environment.empty working-directory))
+ fs
+ (@build.good-shell [])
+ resolution
+ profile)
[actual-runs _] (promise.future (atom.read @runs))]
(wrap (#try.Success (and (n.= expected-runs actual-runs)
(case outcome
diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux
index 6a911e928..74508ef3d 100644
--- a/stdlib/source/test/aedifex/command/build.lux
+++ b/stdlib/source/test/aedifex/command/build.lux
@@ -20,7 +20,8 @@
["." random]]
[world
["." file]
- ["." shell (#+ Shell)]]]
+ ["." shell (#+ Shell)]
+ ["." program]]]
["." // #_
["@." version]
["$/#" // #_
@@ -110,27 +111,10 @@
profile (|> empty-profile
with-program
- with-target)
-
- no-working-directory environment.empty
-
- environment (dictionary.put "user.dir" working-directory environment.empty)]]
+ with-target)]]
($_ _.and
- (_.cover [/.working-directory]
- (and (case (/.working-directory no-working-directory)
- (#try.Success _)
- false
-
- (#try.Failure error)
- true)
- (case (/.working-directory environment)
- (#try.Success _)
- true
-
- (#try.Failure error)
- false)))
(wrap (do promise.monad
- [outcome (/.do! (@version.echo "") environment fs shell ///dependency/resolution.empty
+ [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty working-directory)) fs shell ///dependency/resolution.empty
(with-target empty-profile))]
(_.cover' [/.no-specified-program]
(case outcome
@@ -140,7 +124,7 @@
(#try.Failure error)
(exception.match? /.no-specified-program error)))))
(wrap (do promise.monad
- [outcome (/.do! (@version.echo "") environment fs shell ///dependency/resolution.empty
+ [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty working-directory)) fs shell ///dependency/resolution.empty
(with-program empty-profile))]
(_.cover' [/.no-specified-target]
(case outcome
@@ -150,7 +134,7 @@
(#try.Failure error)
(exception.match? /.no-specified-target error)))))
(wrap (do promise.monad
- [outcome (/.do! (@version.echo "") environment fs shell ///dependency/resolution.empty profile)]
+ [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty working-directory)) fs shell ///dependency/resolution.empty profile)]
(_.cover' [/.Compiler /.no-available-compiler]
(case outcome
(#try.Success _)
@@ -163,7 +147,7 @@
resolution ..resolution]
(wrap (do promise.monad
[verdict (do ///action.monad
- [_ (/.do! console environment fs shell resolution profile)
+ [_ (/.do! console (program.async (program.mock environment.empty working-directory)) fs shell resolution profile)
start (!.use (\ console read-line) [])
end (!.use (\ console read-line) [])]
(wrap (and (text\= /.start start)
@@ -177,7 +161,7 @@
resolution ..resolution]
(wrap (do promise.monad
[verdict (do ///action.monad
- [_ (/.do! console environment fs (..bad-shell []) resolution profile)
+ [_ (/.do! console (program.async (program.mock environment.empty working-directory)) fs (..bad-shell []) resolution profile)
start (!.use (\ console read-line) [])
end (!.use (\ console read-line) [])]
(wrap (and (text\= /.start start)
diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux
index 43c70d8ba..f87e70e85 100644
--- a/stdlib/source/test/aedifex/command/test.lux
+++ b/stdlib/source/test/aedifex/command/test.lux
@@ -19,7 +19,8 @@
["." random]]
[world
["." file]
- ["." shell]]]
+ ["." shell]
+ ["." program]]]
["." // #_
["@." version]
["@." build]
@@ -53,18 +54,14 @@
profile (|> empty-profile
with-program
- with-target)
-
- no-working-directory environment.empty
-
- environment (dictionary.put "user.dir" working-directory environment.empty)]
+ with-target)]
resolution @build.resolution]
($_ _.and
(let [fs (file.mock (\ file.default separator))
console (@version.echo "")]
(wrap (do promise.monad
[verdict (do ///action.monad
- [_ (/.do! console environment fs (@build.good-shell []) resolution profile)
+ [_ (/.do! console (program.async (program.mock environment.empty working-directory)) fs (@build.good-shell []) resolution profile)
build-start (!.use (\ console read-line) [])
build-end (!.use (\ console read-line) [])
test-start (!.use (\ console read-line) [])
@@ -98,7 +95,7 @@
shell.normal
shell.error)]))))))
[])]
- _ (/.do! console environment fs bad-shell resolution profile)
+ _ (/.do! console (program.async (program.mock environment.empty working-directory)) fs bad-shell resolution profile)
build-start (!.use (\ console read-line) [])
build-end (!.use (\ console read-line) [])
test-start (!.use (\ console read-line) [])