smallcheck-series-0.7.0.0: Extra SmallCheck series and utilities

Test.SmallCheck.Series.Text

Description

Following the convention from Data.Text, this module is intended to be imported qualified. For example:

import qualified Test.SmallCheck.Series.Text as T.Series
Synopsis

# Replication

A Text Series that grows by replicating the a Char.

>>> list 4 replicateA
["","a","aa","aaa","aaaa"]


Use this when you don't care about the Chars inside Text.

A Text Series that grows by replicating the NUL Char.

>>> list 4 replicateNull
["","\NUL","\NUL\NUL","\NUL\NUL\NUL","\NUL\NUL\NUL\NUL"]


A Text Series that grows by replicating the given Char.

>>> list 4 $replicateChar '☃' ["","\9731","\9731\9731","\9731\9731\9731","\9731\9731\9731\9731"]  # Enumeration A Text Series that grows by enumerating the latin alphabet. >>> list 4 enumAlphabet ["","a","ab","abc","abcd"]  A Text Series that grows by enumerating every Char. >>> list 4 enumChars ["","\NUL","\NUL\SOH","\NUL\SOH\STX","\NUL\SOH\STX\ETX"]  A Text Series that grows by enumerating every Char in the given String. Notice that the String can be infinite. >>> list 5$ enumString "xyz"
["","x","xy","xyz"]


# Printing

A Text Series that grows with English words.

This is useful when you want to print Series.

>>> let s = list 20 jack
>>> take 3 s
["","All","All work"]
>>> last s
"All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy."


# Extra Unicode planes

A Text Series that grows with the first character of each Unicode plane.

>>> list 3 enumNonBmp
["","\NUL","\NUL\65536","\NUL\65536\131072"]


Notice that this covers the 16 unicode planes.

>>> last (list 16 enumNonBmp) == last (list 17 enumNonBmp)
True