]> code.delx.au - offlineimap/commitdiff
Restrict character generation to first 255
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 07:56:25 +0000 (02:56 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 07:56:25 +0000 (02:56 -0500)
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