aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/package.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-02 03:11:36 -0400
committerEduardo Julian2021-07-02 03:11:36 -0400
commit5cf4efa861075f8276f43a2516f5beacaf610b44 (patch)
treee21cf528d960c29d22cbc7e41180fa09e62f16d6 /stdlib/source/test/aedifex/package.lux
parent744ee69630de59ca3ba660b0aab6361cd17ce1b4 (diff)
No longer employing the capabilities model on the lux/world/* modules.
Capabilities should be opt-in, but using them in the standard library makes them mandatory.
Diffstat (limited to 'stdlib/source/test/aedifex/package.lux')
-rw-r--r--stdlib/source/test/aedifex/package.lux47
1 files changed, 30 insertions, 17 deletions
diff --git a/stdlib/source/test/aedifex/package.lux b/stdlib/source/test/aedifex/package.lux
index 132c51b38..56daf3cad 100644
--- a/stdlib/source/test/aedifex/package.lux
+++ b/stdlib/source/test/aedifex/package.lux
@@ -26,15 +26,16 @@
[world
["." file]]]
[//
- ["@." profile]
+ ["$." profile]
[//
[lux
[data
- ["_." binary]]]]]
+ ["$." binary]]]]]
{#program
["." /
["/#" // #_
["#" profile]
+ ["#." hash ("#\." equivalence)]
["#." pom]
[dependency
["#." status]]
@@ -45,13 +46,13 @@
(Random [//.Profile /.Package])
(do {! random.monad}
[content_size (\ ! map (n.% 100) random.nat)
- content (_binary.random content_size)
+ content ($binary.random content_size)
[profile pom] (random.one (function (_ profile)
(try.to_maybe
(do try.monad
[pom (//pom.write profile)]
(wrap [profile pom]))))
- @profile.random)]
+ $profile.random)]
(wrap [profile (/.local pom content)])))
(def: #export test
@@ -79,19 +80,31 @@
(and (case (get@ #/.origin local)
(#//origin.Local "") true
_ false)
- (and (is? expected_library actual_library)
- (case library_status
- #//status.Unverified true
- _ false))
- (and (is? expected_pom actual_pom)
- (|> (do try.monad
- [xml_pom (\ utf8.codec decode binary_pom)
- decoded_pom (\ xml.codec decode xml_pom)]
- (wrap (\ xml.equivalence = actual_pom decoded_pom)))
- (try.default false))
- (case pom_status
- #//status.Unverified true
- _ false)))))
+ (let [expected_sha1 (//hash.sha-1 expected_library)
+ expected_md5 (//hash.md5 expected_library)]
+ (and (is? expected_library actual_library)
+ (case library_status
+ (#//status.Verified actual_sha1 expected_md5)
+ (and (//hash\= expected_sha1 actual_sha1)
+ (//hash\= expected_md5 expected_md5))
+
+ _
+ false)))
+ (let [expected_sha1 (//hash.sha-1 binary_pom)
+ expected_md5 (//hash.md5 binary_pom)]
+ (and (is? expected_pom actual_pom)
+ (|> (do try.monad
+ [xml_pom (\ utf8.codec decode binary_pom)
+ decoded_pom (\ xml.codec decode xml_pom)]
+ (wrap (\ xml.equivalence = actual_pom decoded_pom)))
+ (try.default false))
+ (case pom_status
+ (#//status.Verified actual_sha1 expected_md5)
+ (and (//hash\= expected_sha1 actual_sha1)
+ (//hash\= expected_md5 expected_md5))
+
+ _
+ false))))))
(_.cover [/.dependencies]
(let [expected (get@ #//.dependencies profile)]
(case (/.dependencies package)