From: John Goerzen Date: Tue, 12 Aug 2008 08:31:00 +0000 (-0500) Subject: Clean up instance Arbitrary Char some more X-Git-Url: https://code.delx.au/offlineimap/commitdiff_plain/04554a8506ddb3f5ecbf10acfbb4b303a7fc429c?hp=b7c530c743d45c82a829e4a1daf4c0ade1c3ff30 Clean up instance Arbitrary Char some more let is pick any character from any position in a list since we only have 256 options anyhow all tests pass. --- diff --git a/testsrc/TestInfrastructure.hs b/testsrc/TestInfrastructure.hs index 9c22808..5ffcd2f 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)) '\xFF') + arbitrary = sized $ \n -> choose ('\NUL', '\xFF') coarbitrary n = variant (toEnum (2 * x + 1)) where x = (abs . fromEnum $ n)::Int