diff options
Diffstat (limited to 'stdlib/source/specification')
-rw-r--r-- | stdlib/source/specification/lux/abstract/hash.lux | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/stdlib/source/specification/lux/abstract/hash.lux b/stdlib/source/specification/lux/abstract/hash.lux index d95fef663..2b6aa5cd6 100644 --- a/stdlib/source/specification/lux/abstract/hash.lux +++ b/stdlib/source/specification/lux/abstract/hash.lux @@ -2,7 +2,9 @@ [library [lux (.except) [abstract - [monad (.only do)]] + [monad (.only do)] + [\\specification + ["[0]S" equivalence]]] [math ["[0]" random (.only Random)] [number @@ -12,12 +14,16 @@ [\\library ["[0]" /]]) -(def .public (spec (open "_#[0]") random) +(def .public (spec (open "/#[0]") random) (All (_ a) (-> (/.Hash a) (Random a) Test)) (do random.monad [parameter random subject random] - (_.coverage [/.Hash] - (if (_#= parameter subject) - (n.= (_#hash parameter) (_#hash subject)) - true)))) + (all _.and + (_.for [/.equivalence] + (equivalenceS.spec /#equivalence random)) + (_.coverage [/.Hash /.hash] + (if (/#= parameter subject) + (n.= (/#hash parameter) (/#hash subject)) + true)) + ))) |