blob: 714905c41741899839677453cf433b4af9e2558a (
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
|
(.module:
[lux #*
["_" test (#+ Test)]
[control
[monad (#+ do)]]
data/text/format
[math
["r" random (#+ Random)]]]
{1
["." / (#+ Equivalence)]})
(def: #export (test (^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))))))))
|