mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-05 06:31:54 -07:00
Arbitrary Word64 for running tests on amd64
Copied from Arbitrary Word8; I don't understand the coarbitrary definition and the Word64 one may be erroneous, but Properties.hs now compiles and passes all tests.
This commit is contained in:
@@ -193,6 +193,14 @@ instance Arbitrary Word8 where
|
|||||||
arbitrary = choose (minBound,maxBound)
|
arbitrary = choose (minBound,maxBound)
|
||||||
coarbitrary n = variant (fromIntegral ((fromIntegral n) `rem` 4))
|
coarbitrary n = variant (fromIntegral ((fromIntegral n) `rem` 4))
|
||||||
|
|
||||||
|
instance Random Word64 where
|
||||||
|
randomR = integralRandomR
|
||||||
|
random = randomR (minBound,maxBound)
|
||||||
|
|
||||||
|
instance Arbitrary Word64 where
|
||||||
|
arbitrary = choose (minBound,maxBound)
|
||||||
|
coarbitrary n = variant (fromIntegral ((fromIntegral n) `rem` 4))
|
||||||
|
|
||||||
integralRandomR :: (Integral a, RandomGen g) => (a,a) -> g -> (a,g)
|
integralRandomR :: (Integral a, RandomGen g) => (a,a) -> g -> (a,g)
|
||||||
integralRandomR (a,b) g = case randomR (fromIntegral a :: Integer,
|
integralRandomR (a,b) g = case randomR (fromIntegral a :: Integer,
|
||||||
fromIntegral b :: Integer) g of
|
fromIntegral b :: Integer) g of
|
||||||
|
Reference in New Issue
Block a user