aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex
diff options
context:
space:
mode:
authorEduardo Julian2020-10-31 02:59:48 -0400
committerEduardo Julian2020-10-31 02:59:48 -0400
commiteea741e9b4a47ae09832311d6d61f0bd6024f673 (patch)
tree9d503f609c322c235811856ffa05232991b9c653 /stdlib/source/test/aedifex
parentcb8f2b36352948108446c7e3b270faa97589bf7a (diff)
Easy to use Rev constants.
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/aedifex.lux2
-rw-r--r--stdlib/source/test/aedifex/artifact.lux20
-rw-r--r--stdlib/source/test/aedifex/local.lux36
3 files changed, 57 insertions, 1 deletions
diff --git a/stdlib/source/test/aedifex.lux b/stdlib/source/test/aedifex.lux
index fd92d9b40..c40939b47 100644
--- a/stdlib/source/test/aedifex.lux
+++ b/stdlib/source/test/aedifex.lux
@@ -10,6 +10,7 @@
["#." input]
["#." command #_
["#/." pom]]
+ ["#." local]
["#." dependency]
["#." profile]
["#." project]
@@ -24,6 +25,7 @@
/artifact.test
/input.test
/command/pom.test
+ /local.test
/dependency.test
/profile.test
/project.test
diff --git a/stdlib/source/test/aedifex/artifact.lux b/stdlib/source/test/aedifex/artifact.lux
index 376f26717..9a4607306 100644
--- a/stdlib/source/test/aedifex/artifact.lux
+++ b/stdlib/source/test/aedifex/artifact.lux
@@ -7,8 +7,17 @@
{[0 #spec]
[/
["$." equivalence]]}]
+ [control
+ [concurrency
+ [promise (#+ Promise)]]]
+ [data
+ ["." text ("#@." equivalence)]]
[math
- ["." random (#+ Random)]]]
+ ["." random (#+ Random)]]
+ [world
+ ["." file]
+ [net
+ ["." uri]]]]
["." / #_
["#." type]
["#." extension]]
@@ -31,6 +40,15 @@
(_.with-cover [/.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
))))
diff --git a/stdlib/source/test/aedifex/local.lux b/stdlib/source/test/aedifex/local.lux
new file mode 100644
index 000000000..a883f565e
--- /dev/null
+++ b/stdlib/source/test/aedifex/local.lux
@@ -0,0 +1,36 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]]
+ [control
+ [concurrency
+ [promise (#+ Promise)]]]
+ [data
+ ["." text]]
+ [math
+ ["." random (#+ Random)]]
+ [world
+ ["." file]]]
+ [//
+ ["@." artifact]]
+ {#program
+ ["." /
+ ["/#" // #_
+ ["#." artifact]]]})
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (do {@ random.monad}
+ [sample @artifact.random
+ #let [fs (: (file.System Promise)
+ (file.mock (:: file.default separator)))]]
+ ($_ _.and
+ (_.cover [/.repository /.path]
+ (let [path (/.path fs sample)]
+ (and (text.starts-with? (/.repository fs)
+ path)
+ (text.ends-with? (//artifact.path fs sample)
+ path))))
+ ))))