diff options
author | Eduardo Julian | 2020-12-22 21:42:17 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-22 21:42:17 -0400 |
commit | cad959345afb8bf0bd1e5eefe6c63f136833b3ce (patch) | |
tree | 698a0189c6d30109a5ef27d67ab61e037abb011e /stdlib/source/test/aedifex | |
parent | 68b1dd82f23d6648ac3d9075a8f84b0174392945 (diff) |
Properly naming unicode Block type.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/aedifex.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/deploy.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/dependency/status.lux | 34 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/hash.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/metadata.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/repository.lux | 30 |
6 files changed, 60 insertions, 28 deletions
diff --git a/stdlib/source/test/aedifex.lux b/stdlib/source/test/aedifex.lux index 2f46df228..eebccdf09 100644 --- a/stdlib/source/test/aedifex.lux +++ b/stdlib/source/test/aedifex.lux @@ -21,7 +21,8 @@ ["#." local] ["#." cache] ["#." dependency - ["#/." resolution]] + ["#/." resolution] + ["#/." status]] ["#." package] ["#." profile] ["#." project] @@ -51,6 +52,7 @@ /cache.test /dependency.test /dependency/resolution.test + /dependency/status.test /package.test /profile.test /project.test 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 |