vty-6.1: A simple terminal UI library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Vty.Output.Mock

Description

This provides a mock terminal implementation that is nice for testing. This transforms the output operations to visible characters which is useful for testing.

Synopsis

Documentation

mockTerminal :: (Applicative m, MonadIO m) => DisplayRegion -> m (MockData, Output) Source #

The mock display terminal produces a string representation of the requested picture. There is *not* an isomorphism between the string representation and the picture. The string representation is a simplification of the picture that is only useful in debugging VTY without considering terminal specific issues.

The mock implementation is useful in manually determining if the sequence of terminal operations matches the expected sequence. The requirement of the produced representation is simplicity in parsing the text representation and determining how the picture was mapped to terminal operations.

The string representation is a sequence of identifiers where each identifier is the name of an operation in the algebra.