aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex
diff options
context:
space:
mode:
authorEduardo Julian2020-12-22 21:42:17 -0400
committerEduardo Julian2020-12-22 21:42:17 -0400
commitcad959345afb8bf0bd1e5eefe6c63f136833b3ce (patch)
tree698a0189c6d30109a5ef27d67ab61e037abb011e /stdlib/source/test/aedifex
parent68b1dd82f23d6648ac3d9075a8f84b0174392945 (diff)
Properly naming unicode Block type.
Diffstat (limited to 'stdlib/source/test/aedifex')
-rw-r--r--stdlib/source/test/aedifex/command/deploy.lux10
-rw-r--r--stdlib/source/test/aedifex/dependency/status.lux34
-rw-r--r--stdlib/source/test/aedifex/hash.lux2
-rw-r--r--stdlib/source/test/aedifex/metadata.lux8
-rw-r--r--stdlib/source/test/aedifex/repository.lux30
5 files changed, 57 insertions, 27 deletions
diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux
index ef08ba39e..18045a20b 100644
--- a/stdlib/source/test/aedifex/command/deploy.lux
+++ b/stdlib/source/test/aedifex/command/deploy.lux
@@ -110,11 +110,11 @@
set.to-list
(export.library fs)
(\ ! map (format.run tar.writer)))
-
- actual-pom (\ repository download artifact ///artifact/extension.pom)
- actual-library (\ repository download artifact ///artifact/extension.lux-library)
- actual-sha-1 (\ repository download artifact ///artifact/extension.sha-1)
- actual-md5 (\ repository download artifact ///artifact/extension.md5)
+
+ actual-pom (\ repository download (///repository.uri artifact ///artifact/extension.pom))
+ actual-library (\ repository download (///repository.uri artifact ///artifact/extension.lux-library))
+ actual-sha-1 (\ repository download (///repository.uri artifact (format ///artifact/extension.lux-library ///artifact/extension.sha-1)))
+ actual-md5 (\ repository download (///repository.uri artifact (format ///artifact/extension.lux-library ///artifact/extension.md5)))
#let [deployed-library!
(\ binary.equivalence =
diff --git a/stdlib/source/test/aedifex/dependency/status.lux b/stdlib/source/test/aedifex/dependency/status.lux
new file mode 100644
index 000000000..90cc547fa
--- /dev/null
+++ b/stdlib/source/test/aedifex/dependency/status.lux
@@ -0,0 +1,34 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ {[0 #spec]
+ [/
+ ["$." equivalence]]}]
+ [math
+ ["." random (#+ Random) ("#\." monad)]]]
+ ["$." /// #_
+ ["#." hash]]
+ {#program
+ ["." /
+ ["//#" /// #_
+ ["#." hash]]]})
+
+(def: #export random
+ (Random /.Status)
+ ($_ random.or
+ (random\wrap [])
+ (random.or ($///hash.random ///hash.sha-1)
+ ($///hash.random ///hash.md5))
+ (random.and ($///hash.random ///hash.sha-1)
+ ($///hash.random ///hash.md5))
+ ))
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Status]
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+ ))))
diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux
index 8bc830801..455835b84 100644
--- a/stdlib/source/test/aedifex/hash.lux
+++ b/stdlib/source/test/aedifex/hash.lux
@@ -25,7 +25,7 @@
[data
["_." binary]]]])
-(def: (random hash)
+(def: #export (random hash)
(All [h]
(-> (-> Binary (/.Hash h))
(Random (/.Hash h))))
diff --git a/stdlib/source/test/aedifex/metadata.lux b/stdlib/source/test/aedifex/metadata.lux
index 6a1ac503a..9dd3fac22 100644
--- a/stdlib/source/test/aedifex/metadata.lux
+++ b/stdlib/source/test/aedifex/metadata.lux
@@ -23,10 +23,10 @@
(do random.monad
[sample @artifact.random]
($_ _.and
- (_.cover [/.for-project]
- (text.ends-with? /.file (/.for-project sample)))
- (_.cover [/.for-version]
- (text.ends-with? /.file (/.for-version sample)))
+ (_.cover [/.project]
+ (text.ends-with? /.file (/.project sample)))
+ (_.cover [/.version]
+ (text.ends-with? /.file (/.version sample)))
)))
/artifact.test
diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux
index ff669d687..5d2b62f57 100644
--- a/stdlib/source/test/aedifex/repository.lux
+++ b/stdlib/source/test/aedifex/repository.lux
@@ -17,7 +17,10 @@
[collection
["." dictionary (#+ Dictionary)]]]
[math
- ["." random (#+ Random)]]]
+ ["." random (#+ Random)]]
+ [world
+ [net
+ ["." uri (#+ URI)]]]]
[//
["@." artifact]]
{#spec
@@ -42,41 +45,34 @@
(-> Version Artifact)
(|>> ["com.github.luxlang" "test-artifact"]))
-(def: item-hash
- (Hash [Artifact Extension])
- (product.hash //artifact.hash
- text.hash))
-
-(exception: (not-found {artifact Artifact}
- {extension Extension})
+(exception: (not-found {uri URI})
(exception.report
- ["Artifact" (//artifact.format artifact)]
- ["Extension" (%.text extension)]))
+ ["URI" (%.text uri)]))
(exception: (invalid-identity {[user _] Identity})
(exception.report
["User" (%.text user)]))
(type: Store
- (Dictionary [Artifact Extension] Binary))
+ (Dictionary URI Binary))
(def: #export empty
Store
- (dictionary.new ..item-hash))
+ (dictionary.new text.hash))
(structure: #export (simulation identity)
(-> Identity (/.Simulation Store))
- (def: (on-download artifact extension state)
- (case (dictionary.get [artifact extension] state)
+ (def: (on-download uri state)
+ (case (dictionary.get uri state)
(#.Some content)
(exception.return [state content])
#.None
- (exception.throw ..not-found [artifact extension])))
- (def: (on-upload requester artifact extension content state)
+ (exception.throw ..not-found [uri])))
+ (def: (on-upload requester uri content state)
(if (\ identity-equivalence = identity requester)
- (exception.return (dictionary.put [artifact extension] content state))
+ (exception.return (dictionary.put uri content state))
(exception.throw ..invalid-identity [requester]))))
(def: #export test