From: John Goerzen Date: Tue, 12 Aug 2008 07:56:25 +0000 (-0500) Subject: Restrict character generation to first 255 X-Git-Url: https://code.delx.au/offlineimap/commitdiff_plain/3403e98ee73a7f57bb4bf295bcffe30ff3dd3a92?ds=sidebyside Restrict character generation to first 255 --- diff --git a/testsrc/TestInfrastructure.hs b/testsrc/TestInfrastructure.hs index 96db4ad..41419bd 100644 --- a/testsrc/TestInfrastructure.hs +++ b/testsrc/TestInfrastructure.hs @@ -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