]> code.delx.au - offlineimap/commitdiff
Clean up instance Arbitrary Char some more
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 08:31:00 +0000 (03:31 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 08:31:00 +0000 (03:31 -0500)
let is pick any character from any position in a list since we only
have 256 options anyhow

all tests pass.

testsrc/TestInfrastructure.hs

index 9c228080bc3d61e84e54e12305e96d864d44ca13..5ffcd2f71e19bade8389417d764b915fe1b63e9f 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)) '\xFF')
+    arbitrary = sized $ \n -> choose ('\NUL', '\xFF')
     coarbitrary n = variant (toEnum (2 * x + 1))
                 where x = (abs . fromEnum $ n)::Int