diff options
Diffstat (limited to 'stdlib/source/test/aedifex/hash.lux')
-rw-r--r-- | stdlib/source/test/aedifex/hash.lux | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux index 472342c70..8bc830801 100644 --- a/stdlib/source/test/aedifex/hash.lux +++ b/stdlib/source/test/aedifex/hash.lux @@ -36,60 +36,60 @@ (def: #export test Test (<| (_.covering /._) - (_.with-cover [/.Hash /.SHA-1 /.MD5]) + (_.for [/.Hash /.SHA-1 /.MD5]) (`` ($_ _.and - (_.with-cover [/.equivalence] - ($_ _.and - ($equivalence.spec /.equivalence (..random /.sha-1)) - ($equivalence.spec /.equivalence (..random /.md5)) - )) - (_.with-cover [/.data] - ($_ _.and - (~~ (template [<hash> <constructor> <exception>] - [(do random.monad - [expected (..random <hash>)] - (_.cover [<hash> <constructor> <exception>] - (and (case (<constructor> (/.data expected)) - (#try.Success actual) - (\ /.equivalence = expected actual) + (_.for [/.equivalence] + ($_ _.and + ($equivalence.spec /.equivalence (..random /.sha-1)) + ($equivalence.spec /.equivalence (..random /.md5)) + )) + (_.for [/.data] + ($_ _.and + (~~ (template [<hash> <constructor> <exception>] + [(do random.monad + [expected (..random <hash>)] + (_.cover [<hash> <constructor> <exception>] + (and (case (<constructor> (/.data expected)) + (#try.Success actual) + (\ /.equivalence = expected actual) - (#try.Failure error) - false) - (case (<constructor> (\ binary.monoid compose - (/.data expected) - (/.data expected))) - (#try.Success actual) - false + (#try.Failure error) + false) + (case (<constructor> (\ binary.monoid compose + (/.data expected) + (/.data expected))) + (#try.Success actual) + false - (#try.Failure error) - (exception.match? <exception> error)))))] + (#try.Failure error) + (exception.match? <exception> error)))))] - [/.sha-1 /.as-sha-1 /.not-a-sha-1] - [/.md5 /.as-md5 /.not-a-md5] - )))) + [/.sha-1 /.as-sha-1 /.not-a-sha-1] + [/.md5 /.as-md5 /.not-a-md5] + )))) (~~ (template [<codec> <hash>] - [(_.with-cover [<codec>] - ($codec.spec /.equivalence <codec> (..random <hash>)))] + [(_.for [<codec>] + ($codec.spec /.equivalence <codec> (..random <hash>)))] [/.sha-1-codec /.sha-1] [/.md5-codec /.md5] )) - (_.with-cover [/.not-a-hash] - ($_ _.and - (~~ (template [<codec> <hash>] - [(do random.monad - [expected (..random <hash>)] - (_.cover [<codec>] - (case (\ <codec> decode - (format (\ <codec> encode expected) - "AABBCC")) - (#try.Success actual) - false + (_.for [/.not-a-hash] + ($_ _.and + (~~ (template [<codec> <hash>] + [(do random.monad + [expected (..random <hash>)] + (_.cover [<codec>] + (case (\ <codec> decode + (format (\ <codec> encode expected) + "AABBCC")) + (#try.Success actual) + false - (#try.Failure error) - (exception.match? /.not-a-hash error))))] + (#try.Failure error) + (exception.match? /.not-a-hash error))))] - [/.sha-1-codec /.sha-1] - [/.md5-codec /.md5] - )))) + [/.sha-1-codec /.sha-1] + [/.md5-codec /.md5] + )))) )))) |