aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2022-08-12 22:26:57 -0400
committerEduardo Julian2022-08-12 22:26:57 -0400
commit772f621c19408c711c1e587668a52a8cfeeea418 (patch)
tree94a53cae11dc6fe5d46f993fc30364490e668d16 /stdlib
parent29922d1411a75f9fb4259d66e427070aae72b3d3 (diff)
Fixes for Aedifex tests.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/library/lux/data/collection/list.lux2
-rw-r--r--stdlib/source/library/lux/world/file.lux6
-rw-r--r--stdlib/source/library/lux/world/shell.lux3
-rw-r--r--stdlib/source/program/aedifex/command/deploy/release.lux9
-rw-r--r--stdlib/source/program/aedifex/format.lux39
-rw-r--r--stdlib/source/program/aedifex/hash.lux2
-rw-r--r--stdlib/source/program/aedifex/parser.lux2
-rw-r--r--stdlib/source/program/aedifex/profile.lux5
-rw-r--r--stdlib/source/program/aedifex/project.lux2
-rw-r--r--stdlib/source/test/aedifex.lux2
-rw-r--r--stdlib/source/test/aedifex/artifact/snapshot/version/value.lux5
-rw-r--r--stdlib/source/test/aedifex/artifact/time/date.lux7
-rw-r--r--stdlib/source/test/aedifex/artifact/time/time.lux3
-rw-r--r--stdlib/source/test/aedifex/cli.lux10
-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
-rw-r--r--stdlib/source/test/aedifex/dependency/resolution.lux3
-rw-r--r--stdlib/source/test/aedifex/input.lux13
-rw-r--r--stdlib/source/test/aedifex/metadata/artifact.lux6
-rw-r--r--stdlib/source/test/aedifex/metadata/snapshot.lux8
-rw-r--r--stdlib/source/test/aedifex/parser.lux31
-rw-r--r--stdlib/source/test/aedifex/profile.lux23
-rw-r--r--stdlib/source/test/aedifex/repository.lux2
-rw-r--r--stdlib/source/test/aedifex/repository/local.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/list.lux2
-rw-r--r--stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux34
30 files changed, 227 insertions, 159 deletions
diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux
index 77e5529b1..cddf68036 100644
--- a/stdlib/source/library/lux/data/collection/list.lux
+++ b/stdlib/source/library/lux/data/collection/list.lux
@@ -143,7 +143,7 @@
<else>)))]
[while {.#Item x (while predicate xs')} {.#End}]
- [until (until predicate xs') xs]
+ [until xs (until predicate xs')]
)
(def .public (split_at n xs)
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux
index 1e2bdd90d..11adc36a7 100644
--- a/stdlib/source/library/lux/world/file.lux
+++ b/stdlib/source/library/lux/world/file.lux
@@ -1337,3 +1337,9 @@
(if ?
(in (exception.except ..cannot_make_file [path]))
(at fs write path content))))
+
+(def .public (copy monad fs from to)
+ (All (_ !) (-> (Monad !) (System !) Path Path (! (Try Any))))
+ (do (try.with monad)
+ [data (at fs read from)]
+ (at fs write to data)))
diff --git a/stdlib/source/library/lux/world/shell.lux b/stdlib/source/library/lux/world/shell.lux
index bd7829907..4101cb3c9 100644
--- a/stdlib/source/library/lux/world/shell.lux
+++ b/stdlib/source/library/lux/world/shell.lux
@@ -82,7 +82,8 @@
(type .public (Shell !)
(Interface
- (is (-> [Environment Path Command (List Argument)] (! (Try (Process !))))
+ (is (-> [Environment Path Command (List Argument)]
+ (! (Try (Process !))))
execute)))
(def .public (async shell)
diff --git a/stdlib/source/program/aedifex/command/deploy/release.lux b/stdlib/source/program/aedifex/command/deploy/release.lux
index 88303069a..5a2496648 100644
--- a/stdlib/source/program/aedifex/command/deploy/release.lux
+++ b/stdlib/source/program/aedifex/command/deploy/release.lux
@@ -97,6 +97,7 @@
[pom ////artifact/extension.pom]
[tar ////artifact/extension.lux_library]
[jar ////artifact/extension.jvm_library]
+ [sha-1 ////artifact/extension.sha-1]
[md5 ////artifact/extension.md5]
)
@@ -142,6 +143,11 @@
(at ////hash.md5_codec encoded)
(at utf8.codec encoded)
(at remote upload (..md5 artifact)))
+ _ (|> it
+ ////hash.sha-1
+ (at ////hash.sha-1_codec encoded)
+ (at utf8.codec encoded)
+ (at remote upload (..sha-1 artifact)))
_ (..release_unsigned_artifact! local remote signature)]
(in [])))
@@ -150,8 +156,7 @@
(do [! ////action.monad]
[_ (///install.do! console fs local profile)
_ (install_dummies! environment local fs artifact)
- .let [working_directory (at environment directory)
- @root (////repository/local.root environment fs)
+ .let [@root (////repository/local.root environment fs)
$bundle (////artifact.bundle (the ////artifact.#version artifact) artifact)
/ (at fs separator)
@local (%.format @root / $bundle)]
diff --git a/stdlib/source/program/aedifex/format.lux b/stdlib/source/program/aedifex/format.lux
index 594b91014..771bcc9de 100644
--- a/stdlib/source/program/aedifex/format.lux
+++ b/stdlib/source/program/aedifex/format.lux
@@ -28,31 +28,31 @@
(def (license [name url type])
(Format /.License)
- (`' [#name (, (code.text name))
- #url (, (code.text url))
- #type (, (when type
- {/.#Repo}
- (' "repo")
+ (`' ["name" (, (code.text name))
+ "url" (, (code.text url))
+ "type" (, (when type
+ {/.#Repo}
+ (' "repo")
- {/.#Manual}
- (' "manual")))]))
+ {/.#Manual}
+ (' "manual")))]))
(def (organization [name url])
(Format /.Organization)
- (`' [#name (, (code.text name))
- #url (, (code.text url))]))
+ (`' ["name" (, (code.text name))
+ "url" (, (code.text url))]))
(def (developer [name url organization])
(Format /.Developer)
(when organization
{.#None}
- (`' [#name (, (code.text name))
- #url (, (code.text url))])
+ (`' ["name" (, (code.text name))
+ "url" (, (code.text url))])
{.#Some value}
- (`' [#name (, (code.text name))
- #url (, (code.text url))
- #organization (, (..organization value))])))
+ (`' ["name" (, (code.text name))
+ "url" (, (code.text url))
+ "organization" (, (..organization value))])))
(def contributor
(Format /.Contributor)
@@ -156,10 +156,18 @@
(` [(, (code.symbol definition))
(,* (list#each code.text parameters))]))
+(def configuration
+ (Format /.Configuration)
+ (|>> (list#each (function (_ [setting value])
+ (list (code.text setting)
+ (code.text value))))
+ list#conjoint
+ code.tuple))
+
(def .public lux_compiler_label
"lux")
-(def (profile value)
+(def .public (profile value)
(Format /.Profile)
(`` (|> ..empty
(..on_list "parents" (the /.#parents value) code.text)
@@ -174,6 +182,7 @@
(..on_maybe "program" (the /.#program value) code.symbol)
(..on_maybe "test" (the /.#test value) code.symbol)
(..on_dictionary "deploy_repositories" (the /.#deploy_repositories value) code.text code.text)
+ (dictionary.has "configuration" (..configuration (the /.#configuration value)))
(,, (with_template [<tag>]
[(dictionary.has (template.text [<tag>]) (..runtime (the <tag> value)))]
diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux
index 64e9784d3..a83752014 100644
--- a/stdlib/source/program/aedifex/hash.lux
+++ b/stdlib/source/program/aedifex/hash.lux
@@ -8,7 +8,7 @@
[monad (.only do)]]
[control
["[0]" try (.only Try)]
- ["[0]" exception (.only exception)]]
+ ["[0]" exception (.only Exception)]]
[data
["[0]" binary (.only Binary)]
["[0]" text (.only)
diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux
index 0327a4cd9..6e64f5bf2 100644
--- a/stdlib/source/program/aedifex/parser.lux
+++ b/stdlib/source/program/aedifex/parser.lux
@@ -288,5 +288,5 @@
(Parser Project)
(at <>.monad each
(dictionary.of_list text.hash)
- (<code>.tuple (<>.many (<>.and <code>.text
+ (<code>.tuple (<>.some (<>.and <code>.text
..profile)))))
diff --git a/stdlib/source/program/aedifex/profile.lux b/stdlib/source/program/aedifex/profile.lux
index 2d9d41b4c..e887160b5 100644
--- a/stdlib/source/program/aedifex/profile.lux
+++ b/stdlib/source/program/aedifex/profile.lux
@@ -164,6 +164,9 @@
Name
"")
+(type .public Configuration
+ (property.List Text))
+
(type .public Profile
(Record
[#parents (List Name)
@@ -178,7 +181,7 @@
#program (Maybe Symbol)
#test (Maybe Symbol)
#deploy_repositories (Dictionary Text Address)
- #configuration (property.List Text)
+ #configuration Configuration
#java Runtime
#js Runtime
#python Runtime
diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux
index 9d0a00f43..d35873c71 100644
--- a/stdlib/source/program/aedifex/project.lux
+++ b/stdlib/source/program/aedifex/project.lux
@@ -7,7 +7,7 @@
["[0]" monad (.only do)]]
[control
["[0]" try (.only Try)]
- ["[0]" exception (.only exception)]]
+ ["[0]" exception (.only Exception)]]
[data
["[0]" text (.only)
["%" \\format (.only format)]]
diff --git a/stdlib/source/test/aedifex.lux b/stdlib/source/test/aedifex.lux
index 41c03b43b..8b859955e 100644
--- a/stdlib/source/test/aedifex.lux
+++ b/stdlib/source/test/aedifex.lux
@@ -10,7 +10,7 @@
["[1][0]" artifact]
["[1][0]" cli]
["[1][0]" command]
- ["[1][0]" dependency
+ ["[1][0]" dependency (.only)
["[1]/[0]" deployment]
["[1]/[0]" resolution]
["[1]/[0]" status]]
diff --git a/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
index 470cd66c7..f116a0a78 100644
--- a/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
+++ b/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
@@ -16,8 +16,9 @@
[number
["n" nat]
["i" int]]]
- [time
- ["[0]" instant]]
+ [world
+ [time
+ ["[0]" instant]]]
[test
["_" property (.only Test)]]]]
["$[0]" ///
diff --git a/stdlib/source/test/aedifex/artifact/time/date.lux b/stdlib/source/test/aedifex/artifact/time/date.lux
index 5efc00d4e..23f0a69f8 100644
--- a/stdlib/source/test/aedifex/artifact/time/date.lux
+++ b/stdlib/source/test/aedifex/artifact/time/date.lux
@@ -16,9 +16,10 @@
[number
["n" nat]
["i" int]]]
- [time
- ["[0]" date (.use "[1]#[0]" equivalence)]
- ["[0]" year]]
+ [world
+ [time
+ ["[0]" date (.use "[1]#[0]" equivalence)]
+ ["[0]" year]]]
[test
["_" property (.only Test)]]]]
[\\program
diff --git a/stdlib/source/test/aedifex/artifact/time/time.lux b/stdlib/source/test/aedifex/artifact/time/time.lux
index d4bc90f4e..90ac9819b 100644
--- a/stdlib/source/test/aedifex/artifact/time/time.lux
+++ b/stdlib/source/test/aedifex/artifact/time/time.lux
@@ -1,7 +1,6 @@
(.require
[library
[lux (.except)
- ["[0]" time]
[abstract
[monad (.only do)]]
[control
@@ -14,6 +13,8 @@
[number
["n" nat]
["i" int]]]
+ [world
+ ["[0]" time]]
[test
["_" property (.only Test)]]]]
[\\program
diff --git a/stdlib/source/test/aedifex/cli.lux b/stdlib/source/test/aedifex/cli.lux
index b388866c6..fa6d9c72c 100644
--- a/stdlib/source/test/aedifex/cli.lux
+++ b/stdlib/source/test/aedifex/cli.lux
@@ -7,15 +7,15 @@
["$[0]" equivalence]]]
[control
["[0]" pipe]
- ["[0]" try]
- [parser
- ["[0]" cli]]]
+ ["[0]" try]]
[data
["[0]" text]
[collection
["[0]" list]]]
[math
["[0]" random (.only Random) (.use "[1]#[0]" monad)]]
+ [program
+ ["cli" \\parser]]
[test
["_" property (.only Test)]]]]
[\\program
@@ -79,7 +79,7 @@
(cli.result /.command)
(pipe.when
{try.#Success [names actual]}
- (and (at (list.equivalence text.equivalence) = (list //.default) names)
+ (and (at (list.equivalence text.equivalence) = (list) names)
(at /.equivalence = expected actual))
{try.#Failure error}
@@ -97,7 +97,7 @@
(cli.result /.command)
(pipe.when
{try.#Success [actual_profile actual_command]}
- (and (at (list.equivalence text.equivalence) = (list expected_profile //.default) actual_profile)
+ (and (at (list.equivalence text.equivalence) = (list expected_profile) actual_profile)
(at /.equivalence = expected_command actual_command))
{try.#Failure error}
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)
diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux
index 0f353d828..ad9d9033f 100644
--- a/stdlib/source/test/aedifex/dependency/resolution.lux
+++ b/stdlib/source/test/aedifex/dependency/resolution.lux
@@ -3,12 +3,13 @@
[lux (.except all)
[abstract
[monad (.only do)]
- ["[0]" predicate]
[\\specification
["$[0]" equivalence]]]
[control
["[0]" try]
["[0]" exception]
+ [function
+ ["[0]" predicate]]
[concurrency
["[0]" async]]]
[data
diff --git a/stdlib/source/test/aedifex/input.lux b/stdlib/source/test/aedifex/input.lux
index 9c296e12c..7dc6ccc8e 100644
--- a/stdlib/source/test/aedifex/input.lux
+++ b/stdlib/source/test/aedifex/input.lux
@@ -43,6 +43,11 @@
(-> (Set Address) (Set Address))
(set.has //.default_repository))
+(def with_defaults
+ (-> Profile Profile)
+ (|>> (revised //.#sources ..with_default_source)
+ (revised //.#repositories ..with_default_repository)))
+
(def .public test
Test
(<| (_.covering /._)
@@ -59,11 +64,7 @@
(at utf8.codec encoded))]
_ (at fs write //project.file profile)
actual (is (Async (Try Profile))
- (/.read async.monad fs (list //.default)))]
- (in (at //.equivalence =
- (|> expected
- (revised //.#sources ..with_default_source)
- (revised //.#repositories ..with_default_repository))
- actual)))]
+ (/.read async.monad fs (list)))]
+ (in (at //.equivalence = (with_defaults expected) actual)))]
(unit.coverage [/.read]
(try.else false verdict)))))))
diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux
index f2d430fb2..27c194d84 100644
--- a/stdlib/source/test/aedifex/metadata/artifact.lux
+++ b/stdlib/source/test/aedifex/metadata/artifact.lux
@@ -8,8 +8,6 @@
[control
["[0]" maybe]
["[0]" try (.use "[1]#[0]" functor)]
- [parser
- ["[0]" environment]]
[concurrency
["[0]" async]]]
[data
@@ -27,7 +25,9 @@
["[0]" code]]
[world
["[0]" file]
- ["[0]" program]
+ ["[0]" environment
+ ["program" /]
+ ["[1]" \\parser]]
["[0]" time (.only)
["[0]" date]
["[0]" year]
diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux
index 34965c98a..fa26186ea 100644
--- a/stdlib/source/test/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/test/aedifex/metadata/snapshot.lux
@@ -8,8 +8,6 @@
[control
["[0]" maybe]
["[0]" try (.use "[1]#[0]" functor)]
- [parser
- ["[0]" environment]]
[concurrency
["[0]" async]]]
[data
@@ -27,7 +25,9 @@
["[0]" code]]
[world
["[0]" file]
- ["[0]" program]
+ ["[0]" environment
+ ["program" /]
+ ["[1]" \\parser]]
["[0]" time (.only)
["[0]" date]
["[0]" year]
@@ -38,7 +38,7 @@
["[0]" unit]
["_" property (.only Test)]]]]
["$[0]" ///
- ["[1][0]" artifact
+ ["[1][0]" artifact (.only)
["[1]/[0]" type]
["[1]/[0]" time]
["[1]/[0]" snapshot
diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux
index 54cdbc17a..cbc67dbab 100644
--- a/stdlib/source/test/aedifex/parser.lux
+++ b/stdlib/source/test/aedifex/parser.lux
@@ -6,7 +6,7 @@
[hash (.only Hash)]]
[control
["[0]" pipe]
- ["[0]" try]]
+ ["[0]" try (.use "[1]#[0]" functor)]]
[data
["[0]" text]
[collection
@@ -40,7 +40,7 @@
(def (list_of random)
(All (_ a) (-> (Random a) (Random (List a))))
(do [! random.monad]
- [size (at ! each (n.% 5) random.nat)]
+ [size (at ! each (|>> (n.% 5) ++) random.nat)]
(random.list size random)))
(def (dictionary_of key_hash key_random value_random)
@@ -72,6 +72,16 @@
(//project.project //.default (at //.monoid identity))
project))
+(def with_defaults
+ (-> Project Project)
+ (|>> ..with_empty_profile
+ dictionary.entries
+ (list#each (function (_ [name profile])
+ [name (|> profile
+ ..with_default_sources
+ ..with_default_repository)]))
+ (dictionary.of_list text.hash)))
+
(def .public test
Test
(<| (_.covering /._)
@@ -84,17 +94,6 @@
//format.project
list
(<code>.result /.project)
- (pipe.when
- {try.#Success actual}
- (|> expected
- ..with_empty_profile
- dictionary.entries
- (list#each (function (_ [name profile])
- [name (|> profile
- ..with_default_sources
- ..with_default_repository)]))
- (dictionary.of_list text.hash)
- (at //project.equivalence = actual))
-
- {try.#Failure error}
- false))))))
+ (try#each (at //project.equivalence = (..with_defaults expected)))
+ (try.else false)
+ )))))
diff --git a/stdlib/source/test/aedifex/profile.lux b/stdlib/source/test/aedifex/profile.lux
index 9a2c5ba3c..4d964ebdd 100644
--- a/stdlib/source/test/aedifex/profile.lux
+++ b/stdlib/source/test/aedifex/profile.lux
@@ -1,6 +1,6 @@
(.require
[library
- [lux (.except)
+ [lux (.except symbol)
[abstract
[monad (.only do)]
[hash (.only Hash)]
@@ -8,9 +8,7 @@
["$[0]" equivalence]
["$[0]" monoid]]]
[control
- ["[0]" try]
- [parser
- ["[0]" cli]]]
+ ["[0]" try]]
[data
["[0]" text (.use "[1]#[0]" equivalence)]
[collection
@@ -26,6 +24,8 @@
[cli
["[0]" compiler (.only)
["$[1]" \\test]]]]]]
+ [program
+ ["cli" \\parser]]
[test
["_" property (.only Test)]]]]
[//
@@ -124,6 +124,11 @@
(Random /.Target)
(random.alphabetic 1))
+(def (symbol module_size short_size)
+ (-> Nat Nat (Random Symbol))
+ (random.and (random.alphabetic module_size)
+ (random.alphabetic short_size)))
+
(def .public random
(Random /.Profile)
(all random.and
@@ -136,11 +141,11 @@
(..list_of $compiler.random)
(..set_of text.hash ..source)
..target
- (random.maybe (random.alphabetic 1))
- (random.maybe (random.alphabetic 2))
- (..dictionary_of text.hash (random.alphabetic 3) ..repository)
- (..list_of (random.and (random.alphabetic 4)
- (random.alphabetic 5)))
+ (random.maybe (symbol 1 2))
+ (random.maybe (symbol 3 4))
+ (..dictionary_of text.hash (random.alphabetic 5) ..repository)
+ (..list_of (random.and (random.alphabetic 6)
+ (random.alphabetic 7)))
(random#in //runtime.default_java)
(random#in //runtime.default_js)
(random#in //runtime.default_python)
diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux
index fd26f3898..f61f1ec50 100644
--- a/stdlib/source/test/aedifex/repository.lux
+++ b/stdlib/source/test/aedifex/repository.lux
@@ -8,7 +8,7 @@
[control
["[0]" io]
["[0]" try]
- ["[0]" exception (.only exception)]]
+ ["[0]" exception (.only Exception)]]
[data
["[0]" product]
["[0]" binary (.only Binary)]
diff --git a/stdlib/source/test/aedifex/repository/local.lux b/stdlib/source/test/aedifex/repository/local.lux
index 96a07f678..874c773b3 100644
--- a/stdlib/source/test/aedifex/repository/local.lux
+++ b/stdlib/source/test/aedifex/repository/local.lux
@@ -5,8 +5,6 @@
[monad (.only do)]]
[control
["[0]" try (.use "[1]#[0]" functor)]
- [parser
- ["[0]" environment]]
[concurrency
["[0]" async]]]
[data
@@ -18,7 +16,9 @@
["[0]" random]]
[world
["[0]" file]
- ["[0]" program]]
+ ["[0]" environment
+ ["program" /]
+ ["[1]" \\parser]]]
[test
["[0]" unit]
["_" property (.only Test)]]]]
diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux
index bd1e684d7..f32a5c3d5 100644
--- a/stdlib/source/test/lux/data/collection/list.lux
+++ b/stdlib/source/test/lux/data/collection/list.lux
@@ -230,7 +230,7 @@
(_.coverage [/.while /.until]
(/#= sample
(/#composite (/.while n.even? sample)
- (/.until n.even? sample))))
+ (/.until (|>> n.even? not) sample))))
(_.coverage [/.sub]
(let [subs (/.sub sub_size sample)]
(and (/.every? (|>> /.size (n.<= sub_size)) subs)
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux
index cf2d5edac..9aa2277d3 100644
--- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux
+++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux
@@ -55,7 +55,7 @@
(random.set n.hash ..spread random.nat)
(random.set i.hash ..spread random.int)
(random.set r.hash ..spread random.rev)
- (random.set f.hash ..spread random.frac)
+ (random.set f.hash ..spread random.safe_frac)
(random.set text.hash ..spread (random.unicode 1))
(all random.and
(random.maybe (random#in ..spread))
@@ -96,7 +96,7 @@
[random.nat n.hash /.#Nat //simple.#Nat]
[random.int i.hash /.#Int //simple.#Int]
[random.rev r.hash /.#Rev //simple.#Rev]
- [random.frac f.hash /.#Frac //simple.#Frac]
+ [random.safe_frac f.hash /.#Frac //simple.#Frac]
[(random.unicode 1) text.hash /.#Text //simple.#Text]
))
@@ -115,22 +115,20 @@
(do [! random.monad]
[arity (..ranged 2 (n.- 2 ..spread))
- it (random.list arity again)
- .let [coverages (list#each product.left it)
- patterns (list#each product.right it)]]
- (in [(|> coverages
- (list.only (|>> /.exhaustive? not))
- list.reversed
- (pipe.when
- {.#End}
- {/.#Exhaustive}
-
- {.#Item last prevs}
- (list#mix (function (_ left right)
- {/.#Seq left right})
- last
- prevs)))
- {//pattern.#Complex {//complex.#Tuple patterns}}]))
+ it (random.list arity again)]
+ (in [(when (|> it
+ (list#each product.left)
+ list.reversed
+ (list.until (|>> /.exhaustive? not)))
+ {.#End}
+ {/.#Exhaustive}
+
+ {.#Item last prevs}
+ (list#mix (function (_ left right)
+ {/.#Seq left right})
+ last
+ prevs))
+ {//pattern.#Complex {//complex.#Tuple (list#each product.right it)}}]))
(do random.monad
[register random.nat]