HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

  • Packagesandwich-0.3.1.0
  • Exports31
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSandwich.hs

Sandwich is a test framework for Haskell. See the documentation for details and usage examples.

Running tests with command line args

3 declarations

These functions will read command line arguments when setting up your tests. These flags allow you filter the test tree, configure formatters, and pass your own custom options.

# Run using the terminal UI formatter, webdriver headless mode, filtering to nodes matching "Login"
stack run my-tests -- --tui --headless -f Login

Running tests

2 declarations

Basic nodes

3 declarations

The basic building blocks of tests.

Context manager nodes

8 declarations

For introducing new contexts into tests and doing setup/teardown.

Parallel nodes

7 declarations

Timing

4 declarations

For timing actions within your tests. Test tree nodes are timed by default.

valuetimeActionByProfile
  1. :: (MonadUnliftIO m, MonadReader context m, HasTestTimer context)
  2. => ProfileName

    Profile name

  3. -> EventName

    Event name

  4. -> m a
  5. -> m a
#

Time a given action with a given profile name and event name. Use when you want to manually specify the profile name.

valuetimeAction
  1. :: (MonadUnliftIO m, HasBaseContextMonad context m, HasTestTimer context)
  2. => EventName

    Event name

  3. -> m a
  4. -> m a
#

Time a given action with a given event name. This name will be the "stack frame" of the given action in the profiling results. This function will use the current timing profile name.

Managed async

4 declarations

If you want to run asyncs within your tests, we can help keep track of them and make sure they get cleaned up.

Exports

0 declarations