From 14287585025b2d8fff1991691def9e643b039ac8 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 10 Dec 2020 00:15:15 -0400 Subject: Re-named "with-cover" to "for". --- stdlib/source/test/aedifex/artifact.lux | 34 +++---- stdlib/source/test/aedifex/artifact/extension.lux | 34 +++---- stdlib/source/test/aedifex/artifact/type.lux | 20 ++-- stdlib/source/test/aedifex/cli.lux | 18 ++-- stdlib/source/test/aedifex/command/auto.lux | 3 +- stdlib/source/test/aedifex/dependency.lux | 10 +- .../source/test/aedifex/dependency/resolution.lux | 6 +- stdlib/source/test/aedifex/hash.lux | 90 +++++++++--------- stdlib/source/test/aedifex/package.lux | 2 +- stdlib/source/test/aedifex/parser.lux | 12 +-- stdlib/source/test/aedifex/profile.lux | 18 ++-- stdlib/source/test/aedifex/project.lux | 104 ++++++++++----------- stdlib/source/test/aedifex/repository.lux | 8 +- 13 files changed, 179 insertions(+), 180 deletions(-) (limited to 'stdlib/source/test/aedifex') diff --git a/stdlib/source/test/aedifex/artifact.lux b/stdlib/source/test/aedifex/artifact.lux index 6ba31f9b7..a718d51f6 100644 --- a/stdlib/source/test/aedifex/artifact.lux +++ b/stdlib/source/test/aedifex/artifact.lux @@ -34,21 +34,21 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Group /.Name /.Version - /.Artifact] - ($_ _.and - (_.with-cover [/.equivalence] - ($equivalence.spec /.equivalence ..random)) + (_.for [/.Group /.Name /.Version + /.Artifact] + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) - (do random.monad - [sample ..random - #let [fs (: (file.System Promise) - (file.mock (\ file.default separator)))]] - (_.cover [/.uri /.path] - (|> (/.path fs sample) - (text.replace-all uri.separator (\ fs separator)) - (text\= (/.uri sample))))) - - /type.test - /extension.test - )))) + (do random.monad + [sample ..random + #let [fs (: (file.System Promise) + (file.mock (\ file.default separator)))]] + (_.cover [/.uri /.path] + (|> (/.path fs sample) + (text.replace-all uri.separator (\ fs separator)) + (text\= (/.uri sample))))) + + /type.test + /extension.test + )))) diff --git a/stdlib/source/test/aedifex/artifact/extension.lux b/stdlib/source/test/aedifex/artifact/extension.lux index e098b0f9c..cd695ae93 100644 --- a/stdlib/source/test/aedifex/artifact/extension.lux +++ b/stdlib/source/test/aedifex/artifact/extension.lux @@ -20,21 +20,21 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Extension] - ($_ _.and - (_.cover [/.lux-library /.jvm-library /.pom - /.sha-1 /.md5] - (let [options (list /.lux-library /.jvm-library /.pom /.sha-1 /.md5) - uniques (set.from-list text.hash options)] - (n.= (list.size options) - (set.size uniques)))) - (_.cover [/.extension] - (`` (and (~~ (template [ ] - [(text\= - (/.extension ))] + (_.for [/.Extension] + ($_ _.and + (_.cover [/.lux-library /.jvm-library /.pom + /.sha-1 /.md5] + (let [options (list /.lux-library /.jvm-library /.pom /.sha-1 /.md5) + uniques (set.from-list text.hash options)] + (n.= (list.size options) + (set.size uniques)))) + (_.cover [/.extension] + (`` (and (~~ (template [ ] + [(text\= + (/.extension ))] - [//.lux-library /.lux-library] - [//.jvm-library /.jvm-library] - [//.pom /.pom] - ))))) - )))) + [//.lux-library /.lux-library] + [//.jvm-library /.jvm-library] + [//.pom /.pom] + ))))) + )))) diff --git a/stdlib/source/test/aedifex/artifact/type.lux b/stdlib/source/test/aedifex/artifact/type.lux index 0d8284d7c..84807a8c6 100644 --- a/stdlib/source/test/aedifex/artifact/type.lux +++ b/stdlib/source/test/aedifex/artifact/type.lux @@ -18,13 +18,13 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Type] - ($_ _.and - (_.cover [/.lux-library /.jvm-library - /.pom /.md5 /.sha-1] - (let [options (list /.lux-library /.jvm-library - /.pom /.md5 /.sha-1) - uniques (set.from-list text.hash options)] - (n.= (list.size options) - (set.size uniques)))) - )))) + (_.for [/.Type] + ($_ _.and + (_.cover [/.lux-library /.jvm-library + /.pom /.md5 /.sha-1] + (let [options (list /.lux-library /.jvm-library + /.pom /.md5 /.sha-1) + uniques (set.from-list text.hash options)] + (n.= (list.size options) + (set.size uniques)))) + )))) diff --git a/stdlib/source/test/aedifex/cli.lux b/stdlib/source/test/aedifex/cli.lux index c4c76f32f..9118132cd 100644 --- a/stdlib/source/test/aedifex/cli.lux +++ b/stdlib/source/test/aedifex/cli.lux @@ -102,13 +102,13 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Compilation /.Command] - ($_ _.and - (_.with-cover [/.equivalence] - ($equivalence.spec /.equivalence ..command)) + (_.for [/.Compilation /.Command] + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..command)) - (_.with-cover [/.command] - ($_ _.and - ..without-profile - ..with-profile - )))))) + (_.for [/.command] + ($_ _.and + ..without-profile + ..with-profile + )))))) diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index aa1b8ebe8..e8f6d17f1 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -6,7 +6,7 @@ [control ["." try] [parser - ["." environment]] + ["." environment (#+ Environment)]] [concurrency ["." atom (#+ Atom)] ["." promise (#+ Promise)]] @@ -24,7 +24,6 @@ [math ["." random]] [world - [environment (#+ Environment)] [console (#+ Console)] ["." shell (#+ Shell)] ["." file (#+ Path) diff --git a/stdlib/source/test/aedifex/dependency.lux b/stdlib/source/test/aedifex/dependency.lux index e7388189c..95fec9800 100644 --- a/stdlib/source/test/aedifex/dependency.lux +++ b/stdlib/source/test/aedifex/dependency.lux @@ -22,8 +22,8 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Dependency] - ($_ _.and - (_.with-cover [/.equivalence] - ($equivalence.spec /.equivalence ..random)) - )))) + (_.for [/.Dependency] + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + )))) diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux index 0b3bf1634..08bbaa4a4 100644 --- a/stdlib/source/test/aedifex/dependency/resolution.lux +++ b/stdlib/source/test/aedifex/dependency/resolution.lux @@ -357,10 +357,10 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Resolution]) + (_.for [/.Resolution]) ($_ _.and - (_.with-cover [/.equivalence] - ($equivalence.spec /.equivalence ..random)) + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) (_.cover [/.empty] (dictionary.empty? /.empty)) diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux index 472342c70..8bc830801 100644 --- a/stdlib/source/test/aedifex/hash.lux +++ b/stdlib/source/test/aedifex/hash.lux @@ -36,60 +36,60 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Hash /.SHA-1 /.MD5]) + (_.for [/.Hash /.SHA-1 /.MD5]) (`` ($_ _.and - (_.with-cover [/.equivalence] - ($_ _.and - ($equivalence.spec /.equivalence (..random /.sha-1)) - ($equivalence.spec /.equivalence (..random /.md5)) - )) - (_.with-cover [/.data] - ($_ _.and - (~~ (template [ ] - [(do random.monad - [expected (..random )] - (_.cover [ ] - (and (case ( (/.data expected)) - (#try.Success actual) - (\ /.equivalence = expected actual) + (_.for [/.equivalence] + ($_ _.and + ($equivalence.spec /.equivalence (..random /.sha-1)) + ($equivalence.spec /.equivalence (..random /.md5)) + )) + (_.for [/.data] + ($_ _.and + (~~ (template [ ] + [(do random.monad + [expected (..random )] + (_.cover [ ] + (and (case ( (/.data expected)) + (#try.Success actual) + (\ /.equivalence = expected actual) - (#try.Failure error) - false) - (case ( (\ binary.monoid compose - (/.data expected) - (/.data expected))) - (#try.Success actual) - false + (#try.Failure error) + false) + (case ( (\ binary.monoid compose + (/.data expected) + (/.data expected))) + (#try.Success actual) + false - (#try.Failure error) - (exception.match? error)))))] + (#try.Failure error) + (exception.match? error)))))] - [/.sha-1 /.as-sha-1 /.not-a-sha-1] - [/.md5 /.as-md5 /.not-a-md5] - )))) + [/.sha-1 /.as-sha-1 /.not-a-sha-1] + [/.md5 /.as-md5 /.not-a-md5] + )))) (~~ (template [ ] - [(_.with-cover [] - ($codec.spec /.equivalence (..random )))] + [(_.for [] + ($codec.spec /.equivalence (..random )))] [/.sha-1-codec /.sha-1] [/.md5-codec /.md5] )) - (_.with-cover [/.not-a-hash] - ($_ _.and - (~~ (template [ ] - [(do random.monad - [expected (..random )] - (_.cover [] - (case (\ decode - (format (\ encode expected) - "AABBCC")) - (#try.Success actual) - false + (_.for [/.not-a-hash] + ($_ _.and + (~~ (template [ ] + [(do random.monad + [expected (..random )] + (_.cover [] + (case (\ decode + (format (\ encode expected) + "AABBCC")) + (#try.Success actual) + false - (#try.Failure error) - (exception.match? /.not-a-hash error))))] + (#try.Failure error) + (exception.match? /.not-a-hash error))))] - [/.sha-1-codec /.sha-1] - [/.md5-codec /.md5] - )))) + [/.sha-1-codec /.sha-1] + [/.md5-codec /.md5] + )))) )))) diff --git a/stdlib/source/test/aedifex/package.lux b/stdlib/source/test/aedifex/package.lux index c1add80d3..aecdcc5af 100644 --- a/stdlib/source/test/aedifex/package.lux +++ b/stdlib/source/test/aedifex/package.lux @@ -47,7 +47,7 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Package]) + (_.for [/.Package]) (do {! random.monad} [[profile package] ..random] ($_ _.and diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux index 248023e80..7aeff7a18 100644 --- a/stdlib/source/test/aedifex/parser.lux +++ b/stdlib/source/test/aedifex/parser.lux @@ -110,9 +110,9 @@ Test (<| (_.covering /._) (_.covering //format._) - (_.with-cover [/.project - //format.Format //format.profile //format.project] - ($_ _.and - ..single-profile - ..multiple-profiles - )))) + (_.for [/.project + //format.Format //format.profile //format.project] + ($_ _.and + ..single-profile + ..multiple-profiles + )))) diff --git a/stdlib/source/test/aedifex/profile.lux b/stdlib/source/test/aedifex/profile.lux index 7f95c07c2..1743a243a 100644 --- a/stdlib/source/test/aedifex/profile.lux +++ b/stdlib/source/test/aedifex/profile.lux @@ -133,12 +133,12 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Distribution /.License /.SCM /.Organization - /.Email /.Developer /.Contributor /.Info - /.Source /.Target /.Name /.Profile] - ($_ _.and - (_.with-cover [/.equivalence] - ($equivalence.spec /.equivalence ..random)) - (_.with-cover [/.monoid] - ($monoid.spec /.equivalence /.monoid ..random)) - )))) + (_.for [/.Distribution /.License /.SCM /.Organization + /.Email /.Developer /.Contributor /.Info + /.Source /.Target /.Name /.Profile] + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + (_.for [/.monoid] + ($monoid.spec /.equivalence /.monoid ..random)) + )))) diff --git a/stdlib/source/test/aedifex/project.lux b/stdlib/source/test/aedifex/project.lux index ec6849e4e..4ea00a3c4 100644 --- a/stdlib/source/test/aedifex/project.lux +++ b/stdlib/source/test/aedifex/project.lux @@ -39,58 +39,58 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Project /.project] - ($_ _.and - (_.with-cover [/.equivalence] - ($equivalence.spec /.equivalence ..random)) - (_.with-cover [/.monoid] - ($monoid.spec /.equivalence /.monoid ..random)) + (_.for [/.Project /.project] + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + (_.for [/.monoid] + ($monoid.spec /.equivalence /.monoid ..random)) - (do random.monad - [[super-name super-profile] ..profile - [dummy-name dummy-profile] (random.filter (|>> product.left (text\= super-name) not) - ..profile) - [sub-name sub-profile] (random.filter (function (_ [name profile]) - (and (not (text\= super-name name)) - (not (text\= dummy-name name)))) - ..profile) - fake-name (random.filter (function (_ name) - (and (not (text\= super-name name)) - (not (text\= dummy-name name)) - (not (text\= sub-name name)))) - (random.ascii/alpha 1)) - #let [project ($_ (\ /.monoid compose) - (/.project super-name super-profile) - (/.project dummy-name dummy-profile) - (/.project sub-name (set@ #//.parents (list super-name) sub-profile))) - circular ($_ (\ /.monoid compose) - (/.project super-name (set@ #//.parents (list sub-name) super-profile)) - (/.project dummy-name dummy-profile) - (/.project sub-name (set@ #//.parents (list super-name) sub-profile)))]] - ($_ _.and - (_.cover [/.profile] - (and (|> (/.profile super-name project) - (try\map (\ //.equivalence = super-profile)) - (try.default false)) - (|> (/.profile dummy-name project) - (try\map (\ //.equivalence = dummy-profile)) - (try.default false)) - (|> (/.profile sub-name project) - (try\map (\ //.equivalence = (\ //.monoid compose sub-profile super-profile))) - (try.default false)))) - (_.cover [/.unknown-profile] - (case (/.profile fake-name project) - (#try.Success _) - false + (do random.monad + [[super-name super-profile] ..profile + [dummy-name dummy-profile] (random.filter (|>> product.left (text\= super-name) not) + ..profile) + [sub-name sub-profile] (random.filter (function (_ [name profile]) + (and (not (text\= super-name name)) + (not (text\= dummy-name name)))) + ..profile) + fake-name (random.filter (function (_ name) + (and (not (text\= super-name name)) + (not (text\= dummy-name name)) + (not (text\= sub-name name)))) + (random.ascii/alpha 1)) + #let [project ($_ (\ /.monoid compose) + (/.project super-name super-profile) + (/.project dummy-name dummy-profile) + (/.project sub-name (set@ #//.parents (list super-name) sub-profile))) + circular ($_ (\ /.monoid compose) + (/.project super-name (set@ #//.parents (list sub-name) super-profile)) + (/.project dummy-name dummy-profile) + (/.project sub-name (set@ #//.parents (list super-name) sub-profile)))]] + ($_ _.and + (_.cover [/.profile] + (and (|> (/.profile super-name project) + (try\map (\ //.equivalence = super-profile)) + (try.default false)) + (|> (/.profile dummy-name project) + (try\map (\ //.equivalence = dummy-profile)) + (try.default false)) + (|> (/.profile sub-name project) + (try\map (\ //.equivalence = (\ //.monoid compose sub-profile super-profile))) + (try.default false)))) + (_.cover [/.unknown-profile] + (case (/.profile fake-name project) + (#try.Success _) + false - (#try.Failure error) - (exception.match? /.unknown-profile error))) - (_.cover [/.circular-dependency] - (case (/.profile sub-name circular) - (#try.Success _) - false + (#try.Failure error) + (exception.match? /.unknown-profile error))) + (_.cover [/.circular-dependency] + (case (/.profile sub-name circular) + (#try.Success _) + false - (#try.Failure error) - (exception.match? /.circular-dependency error))) - )) - )))) + (#try.Failure error) + (exception.match? /.circular-dependency error))) + )) + )))) diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux index 55bd3af19..4da17a059 100644 --- a/stdlib/source/test/aedifex/repository.lux +++ b/stdlib/source/test/aedifex/repository.lux @@ -86,8 +86,8 @@ invalid (random.filter (|>> (\ identity-equivalence = valid) not) ..identity)] ($_ _.and - (_.with-cover [/.mock /.Simulation] - ($/.spec valid (..artifact "1.2.3-YES") - invalid (..artifact "4.5.6-NO") - (/.mock (..simulation valid) ..empty))) + (_.for [/.mock /.Simulation] + ($/.spec valid (..artifact "1.2.3-YES") + invalid (..artifact "4.5.6-NO") + (/.mock (..simulation valid) ..empty))) )))) -- cgit v1.2.3