blob: ac0084e8297eaebc49b7cecceb7adf14acf48b66 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
(.module:
[lux #*
["_" test (#+ Test)]
[abstract/monad (#+ do)]
[data
[text
["%" format (#+ format)]]]
[math
["r" random (#+ Random)]]]
{1
["." / (#+ Equivalence)]})
(def: #export (spec (^open "_@.") generator)
(All [a] (-> (Equivalence a) (Random a) Test))
(do r.monad
[left generator
right generator]
(<| (_.context (%.name (name-of /.Equivalence)))
($_ _.and
(_.test "Reflexivity."
(_@= left left))
(_.test "Symmetry."
(if (_@= left right)
(_@= right left)
(not (_@= right left))))))))
|