git.iko.soy/typeable/attoparsec
on master help sign in
Implement shrink on Arbitrary instances for ByteString types
commit54099141faeb8e6dbddf0008a870e520e5fa342d authorBryan O'Sullivan <bos@serpentine.com> dateSun 5 Apr 2015, 11:31 (12 years ago) parent4eafea9
1 file changed+2
tests/QC/Common.hs+2
tests/QC/Common.hs+2
@@ -42,9 +42,11 @@ toLazyBS = BL.fromChunks . (:[])
4242
4343instance Arbitrary B.ByteString where
4444 arbitrary = B.pack <$> arbitrary
45+ shrink = map B.pack . shrink . B.unpack
4546
4647instance Arbitrary BL.ByteString where
4748 arbitrary = repackBS <$> arbitrary <*> arbitrary
49+ shrink = map BL.pack . shrink . BL.unpack
4850
4951type Repack = NonEmptyList (Positive (Small Int))
5052