vty-5.15.1: A simple terminal UI library

Safe Haskell | None
Language | Haskell2010

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

- type MockData = IORef (UTF8 ByteString)
- mockTerminal :: (Applicative m, MonadIO m) => DisplayRegion -> m (MockData, Output)

# Documentation

type MockData = IORef (UTF8 ByteString) #

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

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 matche 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.