blob: e83571653e17e8243f2ee729f075671728449617 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
(.module:
[lux #*
data/text/format
["_" test (#+ Test)]
[control
[monad (#+ do)]
{[0 #test]
[/
["$." equivalence]
["$." order]
["$." number]
["$." enum]
["$." interval]
["$." monoid]
["$." codec]]}]
[math
["r" random]]]
{1
["." /
//]})
(def: #export test
Test
(<| (_.context (%name (name-of .Int)))
($_ _.and
($equivalence.spec /.equivalence r.int)
($order.spec /.order r.int)
($number.spec /.order /.number r.int)
($enum.spec /.enum r.int)
($interval.spec /.interval r.int)
(<| (_.context "Addition.")
($monoid.spec /.equivalence /.addition r.int))
(<| (_.context "Multiplication.")
($monoid.spec /.equivalence /.multiplication r.int))
(<| (_.context "Minimum.")
($monoid.spec /.equivalence /.minimum r.int))
(<| (_.context "Maximum.")
($monoid.spec /.equivalence /.multiplication r.int))
(<| (_.context "Binary.")
($codec.spec /.equivalence /.binary r.int))
(<| (_.context "Octal.")
($codec.spec /.equivalence /.octal r.int))
(<| (_.context "Decimal.")
($codec.spec /.equivalence /.decimal r.int))
(<| (_.context "Hexadecimal.")
($codec.spec /.equivalence /.hex r.int))
(_.test "Alternate notations."
(and (i/= (bin "+11001001")
(bin "+11,00,10,01"))
(i/= (oct "-615243")
(oct "-615,243"))
(i/= (hex "+deadBEEF")
(hex "+dead,BEEF"))))
)))
|