Copyright | (c) 2014 Bryan O'Sullivan |
---|---|
License | BSD-style |
Maintainer | bos@serpentine.com |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
QuickCheck Generator and shrink functions for testing software that uses Unicode data.
The default Arbitrary
instance for the Char
type intentionally
generates only ASCII values. This can lead to a false sense of
security in cases where Unicode compliance is required, as
encodings that span multiple bytes or code units will simply not be
exercised at all.
This module deliberately avoids using the text
and bytestring
packages to avoid pulling in extra dependencies.
Newtype wrapper for convenience
Generators
Generate a Unicode code point. This has a much larger range than
the default Arbitrary
instance for Char
.
Helpers
Basic generators
planes :: [(Int, Gen Int)] Source
A weighted list of generators that favours ASCII characters, followed by planes 0 and 1.
Predicates
Shrinking functions
shrinkChar :: Char -> [Char] Source
Shrink a Unicode code point.