sandwich-0.3.0.0: Yet another test framework for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Sandwich.Formatters.TerminalUI

Synopsis

Documentation

The terminal UI formatter produces an interactive UI for running tests and inspecting their results.

defaultTerminalUIFormatter :: TerminalUIFormatter Source #

Default settings for the terminal UI formatter.

Options

terminalUIVisibilityThreshold :: TerminalUIFormatter -> Int Source #

The initial visibility threshold to use when the formatter starts.

terminalUIShowRunTimes :: TerminalUIFormatter -> Bool Source #

Whether to show or hide run times.

terminalUIShowVisibilityThresholds :: TerminalUIFormatter -> Bool Source #

Whether to show or hide visibility thresholds next to nodes.

terminalUILogLevel :: TerminalUIFormatter -> Maybe LogLevel Source #

Log level for test log displays.

terminalUIInitialFolding :: TerminalUIFormatter -> InitialFolding Source #

The initial folding settings to use when the formatter starts.

terminalUIDefaultEditor :: TerminalUIFormatter -> Maybe String Source #

Default value to use for the EDITOR environment variable when one is not provided. If Nothing and EDITOR can't be found, edit commands will do nothing.

Here are some recommended values, depending on your preferred editor:

  • Emacs: export EDITOR="emacsclient --eval '(progn (find-file FILE) (goto-line LINE) (forward-char (- COLUMN 1)) (recenter))'"
  • Terminal Emacs: export EDITOR="emacsclient -nw --eval '(progn (find-file FILE) (goto-line LINE) (forward-char (- COLUMN 1)) (recenter))'"
  • Vim: export EDITOR="vim +LINE"

terminalUIOpenInEditor :: TerminalUIFormatter -> Maybe String -> (Text -> IO ()) -> SrcLoc -> IO () Source #

Callback to open a source location in your editor. By default, finds the command in the EDITOR environment variable and invokes it with the strings LINE, COLUMN, and FILE replaced with the line number, column, and file path. If FILE is not found in the string, it will be appended to the command after a space. It's also passed a debug callback that accepts a Text; messages logged with this function will go into the formatter logs.

terminalUICustomExceptionFormatters :: TerminalUIFormatter -> CustomExceptionFormatters Source #

Custom exception formatters, used to nicely format custom exception types.

Auxiliary types

Util