aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/package.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-11-24 05:18:04 -0400
committerEduardo Julian2020-11-24 05:18:04 -0400
commitc4bbfea18d995948012f45a6afda7a6e6ba56f84 (patch)
treeb3c425471830788965776fd173169f084d9f6af4 /stdlib/source/test/aedifex/package.lux
parentd89d837de3475b75587a4293e094d755d2cd4626 (diff)
Better error messages when re-using a name when making a definition.
Diffstat (limited to 'stdlib/source/test/aedifex/package.lux')
-rw-r--r--stdlib/source/test/aedifex/package.lux37
1 files changed, 21 insertions, 16 deletions
diff --git a/stdlib/source/test/aedifex/package.lux b/stdlib/source/test/aedifex/package.lux
index b85f6ce4a..5400d4953 100644
--- a/stdlib/source/test/aedifex/package.lux
+++ b/stdlib/source/test/aedifex/package.lux
@@ -31,31 +31,36 @@
["#." pom]
["#." hash]]]})
+(def: #export random
+ (Random [//.Profile /.Package])
+ (do {! random.monad}
+ [content-size (:: ! map (n.% 100) random.nat)
+ 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)]
+ (wrap [profile (/.local pom content)])))
+
(def: #export test
Test
(<| (_.covering /._)
(_.with-cover [/.Package])
(do {! random.monad}
- [content-size (:: ! map (n.% 100) random.nat)
- 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 package] ..random]
($_ _.and
(_.cover [/.local]
- (let [package (/.local pom content)]
- (and (:: //hash.equivalence =
- (//hash.sha-1 content)
- (get@ #/.sha-1 package))
- (:: //hash.equivalence =
- (//hash.md5 content)
- (get@ #/.md5 package)))))
+ (and (:: //hash.equivalence =
+ (//hash.sha-1 (get@ #/.library package))
+ (get@ #/.sha-1 package))
+ (:: //hash.equivalence =
+ (//hash.md5 (get@ #/.library package))
+ (get@ #/.md5 package))))
(_.cover [/.dependencies]
(let [expected (get@ #//.dependencies profile)]
- (case (/.dependencies (/.local pom content))
+ (case (/.dependencies package)
(#try.Success actual)
(:: set.equivalence = expected actual)