Revision 095d7ac0 Ganeti/HTools/QC.hs
b/Ganeti/HTools/QC.hs | ||
---|---|---|
18 | 18 |
|
19 | 19 |
-- copied from the introduction to quickcheck |
20 | 20 |
instance Arbitrary Char where |
21 |
arbitrary = choose ('\32', '\128')
|
|
21 |
arbitrary = choose ('\32', '\128') |
|
22 | 22 |
|
23 | 23 |
-- let's generate a random instance |
24 | 24 |
instance Arbitrary Instance.Instance where |
... | ... | |
81 | 81 |
where _types = pmap::PeerMap.PeerMap |
82 | 82 |
puniq = PeerMap.accumArray const pmap |
83 | 83 |
|
84 |
-- Container tests |
|
85 |
|
|
86 |
prop_Container_addTwo cdata i1 i2 = |
|
87 |
fn i1 i2 cont == fn i2 i1 cont && |
|
88 |
fn i1 i2 cont == fn i1 i2 (fn i1 i2 cont) |
|
89 |
where _types = (cdata::[Int], |
|
90 |
i1::Int, i2::Int) |
|
91 |
cont = foldl (\c x -> Container.add x x c) Container.empty cdata |
|
92 |
fn x1 x2 = Container.addTwo x1 x1 x2 x2 |
|
93 |
|
|
94 |
|
|
84 | 95 |
-- Simple instance tests, we only have setter/getters |
85 | 96 |
|
86 | 97 |
prop_Instance_setIdx inst idx = |
Also available in: Unified diff