quickcheck-text-0.1.2.1: Alternative arbitrary instance for Text

Safe Haskell | None
Language | Haskell2010

Test.QuickCheck.Utf8

Contents

- Generators for single characters

Synopsis

- genValidUtf8 :: Gen Text
- shrinkValidUtf8 :: Text -> [Text]
- utf8BS :: Gen ByteString
- shrinkUtf8BS :: ByteString -> [ByteString]
- genValidUtf81 :: Gen Text
- shrinkValidUtf81 :: Text -> [Text]
- utf8BS1 :: Gen ByteString
- shrinkUtf8BS1 :: ByteString -> [ByteString]
- genChar :: Gen Char
- genUtf8Character :: Gen ByteString
- oneByte :: Gen ByteString
- twoByte :: Gen ByteString
- threeByte :: Gen ByteString

# Documentation

genValidUtf8 :: Gen Text Source #

Generate a possibly-empty valid UTF-8 `Text` value.

shrinkValidUtf8 :: Text -> [Text] Source #

Shrink a possible-empty valid UTF-8 `Text` value.

utf8BS :: Gen ByteString Source #

Generate a possibly-empty sequence of bytes which represent a valid UTF-8 code point.

shrinkUtf8BS :: ByteString -> [ByteString] Source #

Shrink a possible-empty sequence of bytes which represent a valid UTF-8 code point.

genValidUtf81 :: Gen Text Source #

Like `genValidUtf8`, but does not allow empty `Text` values.

shrinkValidUtf81 :: Text -> [Text] Source #

List `genValidUtf8`, bute does not allow empty `Text` values.

utf8BS1 :: Gen ByteString Source #

Like `utf8BS`, but does not allow empty `ByteString`s.

shrinkUtf8BS1 :: ByteString -> [ByteString] Source #

Like `shrinkUtf8BS`, but does not allow empty `ByteString`s.

# Generators for single characters

genChar :: Gen Char Source #

Generate a valid `Char`. Note that this is UTF-16, not UTF-8, but the intent is the same: the Arbitrary instance for `Char` in quickcheck makes no attempt to generate valid non-ASCII characters at this time.

genUtf8Character :: Gen ByteString Source #

A valid UTF-8 character, one to three bytes long.

oneByte :: Gen ByteString Source #

Single-byte UTF-8 (i.e., a standard ASCII byte with a cleared MSB).

twoByte :: Gen ByteString Source #

threeByte :: Gen ByteString Source #