tesths-0.2.2.1: A lightweight testing framework for Haskell
CopyrightThodoris Papakonstantinou 2026
LicenseLGPL-3
Maintainerdev@tpapak.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

TestHS

Description

A minimal pure-functional test harness. Build a list of Test values using testPassed and testFailed, then report results with reportTests (pure tests) or reportTestsIO (IO tests). Exits with failure if any test fails.

Synopsis

Documentation

data Test Source #

Test data type

Instances

Instances details
Show Test Source # 
Instance details

Defined in TestHS

Methods

showsPrec :: Int -> Test -> ShowS #

show :: Test -> String #

showList :: [Test] -> ShowS #

Eq Test Source # 
Instance details

Defined in TestHS

Methods

(==) :: Test -> Test -> Bool #

(/=) :: Test -> Test -> Bool #

runTest :: Test -> IO Test Source #

run pure test

reportTests :: [Test] -> IO () Source #

Run a list of pure tests, print results, and exit with failure if any fail.

reportTestsIO :: [IO Test] -> IO () Source #

Run tests with IO

testPassed :: String -> String -> Test Source #

Create a passing test with a name and a result message.

testFailed :: String -> (String, String) -> Test Source #

Create a failing test with a name and an (expected, got) pair.