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/repository | |
parent | 68b1dd82f23d6648ac3d9075a8f84b0174392945 (diff) |
Properly naming unicode Block type.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/aedifex/repository.lux | 30 |
1 files changed, 13 insertions, 17 deletions
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 |