X-Git-Url: https://code.delx.au/offlineimap/blobdiff_plain/08e21d9d20d07d84ae1e819d1d81c82daae6b722..e76000bc1846d6a989bfab9e4db5319304562df2:/testsrc/TestInfrastructure.hs diff --git a/testsrc/TestInfrastructure.hs b/testsrc/TestInfrastructure.hs index feb058e..ec22ba7 100644 --- a/testsrc/TestInfrastructure.hs +++ b/testsrc/TestInfrastructure.hs @@ -60,8 +60,8 @@ instance Random Word8 where random g = randomR (minBound, maxBound) g instance Arbitrary Char where - arbitrary = sized $ \n -> choose (toEnum 0, min (toEnum n) maxBound) - coarbitrary n = variant (if (fromEnum n) >= 0 then toEnum (2 * x) else toEnum (2 * x + 1)) + arbitrary = sized $ \n -> choose (toEnum 0, min (toEnum (n * 0x50)) maxBound) + coarbitrary n = variant (toEnum (2 * x + 1)) where x = (abs . fromEnum $ n)::Int -- Modified from HUnit