Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- newtype ArbByteString = ABS {}
- newtype ArbByteString1M = ABS1M {}
- newtype ArbByteString10M = ABS10M {}
- fastRandBs :: Int -> Gen ByteString
- slowRandBs :: Int -> Gen ByteString
Documentation
newtype ArbByteString Source #
A ByteString wrapper so we can implement Arbitrary for ByteString. This will currently generate random ByteStrings of length 0 to 100KB.
newtype ArbByteString1M Source #
A wrapper to generate 1MB bytestrings. The shrink implementation still returns ArbByteString1M instances, of course, but they're smaller than 1MB.
newtype ArbByteString10M Source #
A wrapper to generate 10MB bytestrings. I should really figure out how type-level Nats work, so one can just do (ArbByteStringN 10000000) and have selectable sizes, but I don't see how to do that yet, so 10MB is as big as this library goes. As with the 1MB version, shrink here will generate ArbByteString10M instances that wrap ByteStrings smaller than 10MB.
fastRandBs :: Int -> Gen ByteString Source #
Generate a bunch of binary data quickly. This abuses the cryptohash skein function to generate a megabyte of data at a time, and then concats chunks until it has enough.
slowRandBs :: Int -> Gen ByteString Source #
Generate binary data slowly. This generates a list of Word8s, and then uses Data.ByteString.pack to concatenate it into a single ByteString.