Revision 942a9a6a htest/Test/Ganeti/BasicTypes.hs
b/htest/Test/Ganeti/BasicTypes.hs | ||
---|---|---|
114 | 114 |
-> Fun Int (Result Int) |
115 | 115 |
-> Property |
116 | 116 |
prop_monad_laws a m (Fun _ k) (Fun _ h) = |
117 |
printTestCase "return a >>= k == k a" ((return a >>= k) ==? k a) .&&. |
|
118 |
printTestCase "m >>= return == m" ((m >>= return) ==? m) .&&. |
|
119 |
printTestCase "m >>= (\\x -> k x >>= h) == (m >>= k) >>= h)" |
|
117 |
conjoin |
|
118 |
[ printTestCase "return a >>= k == k a" ((return a >>= k) ==? k a) |
|
119 |
, printTestCase "m >>= return == m" ((m >>= return) ==? m) |
|
120 |
, printTestCase "m >>= (\\x -> k x >>= h) == (m >>= k) >>= h)" |
|
120 | 121 |
((m >>= (\x -> k x >>= h)) ==? ((m >>= k) >>= h)) |
122 |
] |
|
121 | 123 |
|
122 | 124 |
-- | Tests the monad plus laws ( mzero >>= f = mzero, v >> mzero = mzero). |
123 | 125 |
prop_monadplus_mzero :: Result Int -> Fun Int (Result Int) -> Property |
Also available in: Unified diff