aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/command
diff options
context:
space:
mode:
authorEduardo Julian2021-07-12 00:03:36 -0400
committerEduardo Julian2021-07-12 00:03:36 -0400
commit86df87512966e8038d70624ab654262ce14a915c (patch)
treee96d6709c04e7f3fc77f9d9912b86ef34e9c7ef7 /stdlib/source/test/aedifex/command
parentabe24425ced15fd784ef6c62d6f186af72b491db (diff)
Better syntax for parallel-hierarchy imports.
Diffstat (limited to 'stdlib/source/test/aedifex/command')
-rw-r--r--stdlib/source/test/aedifex/command/auto.lux7
-rw-r--r--stdlib/source/test/aedifex/command/build.lux50
-rw-r--r--stdlib/source/test/aedifex/command/clean.lux4
-rw-r--r--stdlib/source/test/aedifex/command/deploy.lux4
-rw-r--r--stdlib/source/test/aedifex/command/deps.lux4
-rw-r--r--stdlib/source/test/aedifex/command/install.lux4
-rw-r--r--stdlib/source/test/aedifex/command/pom.lux4
-rw-r--r--stdlib/source/test/aedifex/command/test.lux14
-rw-r--r--stdlib/source/test/aedifex/command/version.lux4
9 files changed, 57 insertions, 38 deletions
diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux
index effc80871..dfb4dc672 100644
--- a/stdlib/source/test/aedifex/command/auto.lux
+++ b/stdlib/source/test/aedifex/command/auto.lux
@@ -34,14 +34,14 @@
["." // #_
["$." version]
["$." build]]
- {#program
+ [\\program
["." /
["//#" /// #_
[command (#+ Command)]
["#" profile (#+ Profile)]
["#." action]
[dependency
- [resolution (#+ Resolution)]]]]})
+ [resolution (#+ Resolution)]]]]])
(def: (command expected_runs end_signal fs dummy_file)
(-> Nat Text (file.System Promise) file.Path
@@ -89,7 +89,7 @@
expected_runs (\ ! map (|>> (n.% 10) (n.max 2)) random.nat)
dummy_path (\ ! map (|>> (format source /)) (random.ascii/alpha 5))
- resolution $build.resolution]
+ [compiler resolution] $build.resolution]
($_ _.and
(wrap (do promise.monad
[verdict (do ///action.monad
@@ -99,6 +99,7 @@
_ (\ watcher poll [])]
(do {! promise.monad}
[no_dangling_process! (|> profile
+ (set@ #///.compiler compiler)
((/.do! 1 watcher command)
($version.echo "")
(program.async (program.mock environment.empty home working_directory))
diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux
index 9d37ceb00..191ac1039 100644
--- a/stdlib/source/test/aedifex/command/build.lux
+++ b/stdlib/source/test/aedifex/command/build.lux
@@ -16,7 +16,7 @@
[collection
["." dictionary]]]
[math
- ["." random]]
+ ["." random (#+ Random)]]
[world
["." file]
["." shell (#+ Shell)]
@@ -25,15 +25,15 @@
["@." version]
["$/#" // #_
["#." package]]]
- {#program
+ [\\program
["." /
["//#" /// #_
["#" profile (#+ Profile)]
["#." action]
["#." artifact
["#/." type]]
- ["#." dependency
- ["#/." resolution]]]]})
+ ["#." dependency (#+ Dependency)
+ ["#/." resolution (#+ Resolution)]]]]])
(def: #export good_shell
(-> Any (Shell IO))
@@ -72,25 +72,35 @@
(#try.Success [state shell.error]))))))))
(def: compiler
+ (Random Dependency)
(do random.monad
[lux_version (random.ascii/alpha 5)
- #let [jvm_compiler {#///dependency.artifact {#///artifact.group /.lux_group
- #///artifact.name /.jvm_compiler_name
- #///artifact.version lux_version}
- #///dependency.type ///artifact/type.lux_library}
- js_compiler {#///dependency.artifact {#///artifact.group /.lux_group
+ #let [js_compiler {#///dependency.artifact {#///artifact.group /.lux_group
#///artifact.name /.js_compiler_name
#///artifact.version lux_version}
- #///dependency.type ///artifact/type.lux_library}]]
- (random.either (wrap jvm_compiler)
- (wrap js_compiler))))
+ #///dependency.type ///artifact/type.js_library}]]
+ (`` ($_ random.either
+ (wrap js_compiler)
+ (~~ (template [<compiler>]
+ [(wrap {#///dependency.artifact {#///artifact.group /.lux_group
+ #///artifact.name <compiler>
+ #///artifact.version lux_version}
+ #///dependency.type ///artifact/type.lux_library})]
+
+ [/.jvm_compiler_name]
+ [/.python_compiler_name]
+ [/.lua_compiler_name]
+ [/.ruby_compiler_name]
+ ))))))
(def: #export resolution
+ (Random [Dependency Resolution])
(do random.monad
[dependency ..compiler
[_ package] $///package.random]
- (wrap (|> ///dependency/resolution.empty
- (dictionary.put dependency package)))))
+ (wrap [dependency
+ (|> ///dependency/resolution.empty
+ (dictionary.put dependency package))])))
(def: #export test
Test
@@ -136,10 +146,12 @@
(exception.match? /.no_available_compiler error)))))
(do !
[#let [console (@version.echo "")]
- resolution ..resolution]
+ [compiler resolution] ..resolution]
(wrap (do promise.monad
[verdict (do ///action.monad
- [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs shell resolution profile)
+ [_ (/.do! console (program.async (program.mock environment.empty home working_directory))
+ fs shell resolution
+ (set@ #///.compiler compiler profile))
start (\ console read_line [])
end (\ console read_line [])]
(wrap (and (text\= /.start start)
@@ -150,10 +162,12 @@
(try.default false verdict)))))
(do !
[#let [console (@version.echo "")]
- resolution ..resolution]
+ [compiler resolution] ..resolution]
(wrap (do promise.monad
[verdict (do ///action.monad
- [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (shell.async (..bad_shell [])) resolution profile)
+ [_ (/.do! console (program.async (program.mock environment.empty home working_directory))
+ fs (shell.async (..bad_shell [])) resolution
+ (set@ #///.compiler compiler profile))
start (\ console read_line [])
end (\ console read_line [])]
(wrap (and (text\= /.start start)
diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux
index e23e99b96..6ee155b33 100644
--- a/stdlib/source/test/aedifex/command/clean.lux
+++ b/stdlib/source/test/aedifex/command/clean.lux
@@ -29,11 +29,11 @@
[lux
[data
["$." binary]]]]]]
- {#program
+ [\\program
["." /
["//#" /// #_
["#" profile]
- ["#." action (#+ Action)]]]})
+ ["#." action (#+ Action)]]]])
(def: node_name
(Random Text)
diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux
index a40d8e394..7b3664da8 100644
--- a/stdlib/source/test/aedifex/command/deploy.lux
+++ b/stdlib/source/test/aedifex/command/deploy.lux
@@ -36,7 +36,7 @@
[//
["$." profile]
["$." repository]]]
- {#program
+ [\\program
["." /
["//#" /// #_
["#" profile]
@@ -46,7 +46,7 @@
["#." repository (#+ Repository)
["#/." remote]]
["#." artifact (#+ Artifact)
- ["#/." extension]]]]})
+ ["#/." extension]]]]])
(def: (execute! program repository fs artifact profile)
(-> (Program Promise) (Repository Promise) (file.System Promise)
diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux
index 819495c02..63561542d 100644
--- a/stdlib/source/test/aedifex/command/deps.lux
+++ b/stdlib/source/test/aedifex/command/deps.lux
@@ -32,7 +32,7 @@
["#." artifact]
["#." dependency #_
["#/." resolution]]]]
- {#program
+ [\\program
["." /
["/#" // #_
["#." clean]
@@ -49,7 +49,7 @@
["#/." status]]
["#." repository
["#/." origin]
- ["#/." local]]]]]})
+ ["#/." local]]]]]])
(def: #export test
Test
diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux
index 0e8a95526..ae9885401 100644
--- a/stdlib/source/test/aedifex/command/install.lux
+++ b/stdlib/source/test/aedifex/command/install.lux
@@ -26,7 +26,7 @@
[//
["$." profile]
["$." artifact]]]
- {#program
+ [\\program
["." /
["/#" // #_
["/#" // #_
@@ -36,7 +36,7 @@
["#." artifact
["#/." extension]]
["#." repository #_
- ["#/." local]]]]]})
+ ["#/." local]]]]]])
(def: #export (make_sources! fs sources)
(-> (file.System Promise) (Set file.Path) (Action (List Any)))
diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux
index 2ac23ec7a..39e2eecfc 100644
--- a/stdlib/source/test/aedifex/command/pom.lux
+++ b/stdlib/source/test/aedifex/command/pom.lux
@@ -22,12 +22,12 @@
["@." version]
[//
["@." profile]]]
- {#program
+ [\\program
["." /
["//#" /// #_
["#" profile]
["#." action]
- ["#." pom]]]})
+ ["#." pom]]]])
(def: #export test
Test
diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux
index 47e2ed2b3..a6029ba8c 100644
--- a/stdlib/source/test/aedifex/command/test.lux
+++ b/stdlib/source/test/aedifex/command/test.lux
@@ -26,7 +26,7 @@
["@." build]
["$/#" // #_
["#." package]]]
- {#program
+ [\\program
["." /
["/#" // #_
["#." build]
@@ -36,7 +36,7 @@
["#." artifact
["#/." type]]
["#." dependency
- ["#/." resolution]]]]]})
+ ["#/." resolution]]]]]])
(def: #export test
Test
@@ -56,13 +56,15 @@
profile (|> empty_profile
with_test
with_target)]
- resolution @build.resolution]
+ [compiler resolution] @build.resolution]
($_ _.and
(let [fs (file.mock (\ file.default separator))
console (@version.echo "")]
(wrap (do promise.monad
[verdict (do ///action.monad
- [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (shell.async (@build.good_shell [])) resolution profile)
+ [_ (/.do! console (program.async (program.mock environment.empty home working_directory))
+ fs (shell.async (@build.good_shell [])) resolution
+ (set@ #///.compiler compiler profile))
build_start (\ console read_line [])
build_end (\ console read_line [])
test_start (\ console read_line [])
@@ -96,7 +98,9 @@
shell.normal
shell.error)]))))))
[])]
- _ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (shell.async bad_shell) resolution profile)
+ _ (/.do! console (program.async (program.mock environment.empty home working_directory))
+ fs (shell.async bad_shell) resolution
+ (set@ #///.compiler compiler profile))
build_start (\ console read_line [])
build_end (\ console read_line [])
test_start (\ console read_line [])
diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux
index 1bbb7f874..d3f815ed1 100644
--- a/stdlib/source/test/aedifex/command/version.lux
+++ b/stdlib/source/test/aedifex/command/version.lux
@@ -24,8 +24,8 @@
["." console (#+ Console Mock)]]]
[///
["@." profile]]
- {#program
- ["." /]})
+ [\\program
+ ["." /]])
(exception: #export console_is_closed!)