]> code.delx.au - offlineimap/blobdiff - testsrc/TestInfrastructure.hs
Restrict character generation to first 255
[offlineimap] / testsrc / TestInfrastructure.hs
index 96db4ad4ea4d44750f377ef7531a1c530b5bdc89..41419bdddb9150b09afb03fba3c6ebe2fdd8d16d 100644 (file)
@@ -60,7 +60,7 @@ instance Random Word8 where
     random g = randomR (minBound, maxBound) g
 
 instance Arbitrary Char where
-    arbitrary = sized $ \n -> choose (toEnum 0, min (toEnum (n * 0x50)) maxBound)
+    arbitrary = sized $ \n -> choose (toEnum 0, min (toEnum (n * 0x50)) '\xFF')
     coarbitrary n = variant (toEnum (2 * x + 1))
                 where x = (abs . fromEnum $ n)::Int