From 04554a8506ddb3f5ecbf10acfbb4b303a7fc429c Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Tue, 12 Aug 2008 03:31:00 -0500 Subject: [PATCH] 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. --- testsrc/TestInfrastructure.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.2