tasty-discover-4.2.1: Test discovery for the tasty framework.

Safe Haskell | Safe
Language | Haskell2010

Test.Tasty.Generator

Contents

- Types
- Generators
- Boilerplate Formatter
- Type Constructor

Description

The test generator boilerplate module.

Any test that is supported (HUnit, HSpec, etc.) provides here, a generator type with all the context necessary for outputting the necessary boilerplate for the generated main function that will run all the tests.

Synopsis

- data Generator = Generator {
  - generatorPrefix :: String
  - generatorImport :: String
  - generatorClass :: String
  - generatorSetup :: Test -> String
  }
- data Test = Test {
  - testModule :: String
  - testFunction :: String
  }
- generators :: [Generator]
- getGenerator :: Test -> Generator
- getGenerators :: [Test] -> [Generator]
- showSetup :: Test -> String -> String
- mkTest :: FilePath -> String -> Test

# Types

data Generator Source #

The generator type.

Constructors

Generator |

Fields

- generatorPrefix :: String

  Generator prefix.

- generatorImport :: String

  Module import path.

- generatorClass :: String

  Generator class.

- generatorSetup :: Test -> String

  Generator setup.

data Test Source #

The test type.

Constructors

Test |

Fields

- testModule :: String

  Module name.

- testFunction :: String

  Function name.

#### Instances

Instances details

Eq Test Source # |
Instance details Defined in Test.Tasty.Generator Methods (==) :: Test -> Test -> Bool Source # (/=) :: Test -> Test -> Bool Source #
Ord Test Source # |
Instance details Defined in Test.Tasty.Generator Methods compare :: Test -> Test -> Ordering Source # (<) :: Test -> Test -> Bool Source # (<=) :: Test -> Test -> Bool Source # (>) :: Test -> Test -> Bool Source # (>=) :: Test -> Test -> Bool Source # max :: Test -> Test -> Test Source # min :: Test -> Test -> Test Source #
Show Test Source # |
Instance details Defined in Test.Tasty.Generator Methods showsPrec :: Int -> Test -> ShowS Source # show :: Test -> String Source # showList :: [Test] -> ShowS Source #

# Generators

generators :: [Generator] Source #

All types of tests supported for boilerplate generation.

getGenerator :: Test -> Generator Source #

Generator retriever (single).

getGenerators :: [Test] -> [Generator] Source #

Generator retriever (many).

# Boilerplate Formatter

showSetup :: Test -> String -> String Source #

Boilerplate formatter.

# Type Constructor

mkTest :: FilePath -> String -> Test Source #

`Test` constructor.