Source

text / tests / QuickCheckUtils.hs

Diff from to

File tests/QuickCheckUtils.hs

 
 module QuickCheckUtils where
 
+import Data.Int (Int64)
 import Data.Word (Word8, Word16, Word32)
 import qualified Data.Text as T
 import qualified Data.Text.Lazy as TL
                                          fromIntegral b :: Integer) g of
                             (x,h) -> (fromIntegral x, h)
 
+instance Random Int64 where
+    randomR = integralRandomR
+    random  = randomR (minBound,maxBound)
+
+instance Arbitrary Int64 where
+    arbitrary     = choose (minBound,maxBound)
+    coarbitrary c = variant (fromEnum c `rem` 4)
+
 instance Random Word8 where
     randomR = integralRandomR
     random  = randomR (minBound,maxBound)