From 5cf4efa861075f8276f43a2516f5beacaf610b44 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 2 Jul 2021 03:11:36 -0400 Subject: 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.--- stdlib/source/test/aedifex/package.lux | 47 ++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'stdlib/source/test/aedifex/package.lux') 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) -- cgit v1.2.3