on 5c8ab4e help sign in
text/tests/QuickCheckUtils.hs
17 lines 415 B history raw
1module QuickCheckUtils where
3import Test.QuickCheck
4import Test.QuickCheck.Batch
6import Data.Char
8import Data.Text
9import Data.Text.Internal
11instance Arbitrary Char where
12 arbitrary = oneof [choose ('\0','\55295'), choose ('\57334','\1114111')]
13 coarbitrary c = variant (ord c `rem` 4)
15instance Arbitrary Text where
16 arbitrary = pack `fmap` arbitrary
17 coarbitrary s = coarbitrary (unpack s)