mirror of
https://github.com/xmonad/xmonad.git
synced 2025-07-31 12:11:53 -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)
|
||||
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 (a,b) g = case randomR (fromIntegral a :: Integer,
|
||||
fromIntegral b :: Integer) g of
|
||||
|
Reference in New Issue
Block a user