# HUnit

> A JUnit-style unit testing framework for Haskell

Source: https://talira.ai/catalog/hunit-c6f4fsc5
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / testing / frameworks](https://talira.ai/categories/developer-tools/testing/frameworks), [languages / haskell](https://talira.ai/categories/languages/haskell)
- Licence: BSD-3-Clause[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Simon Hengel](https://talira.ai/orgs/simon-hengel.md)

HUnit is a unit testing framework for Haskell, adapted from Java's JUnit. You write test cases with assertions such as assertEqual and assertBool, name them with TestLabel, group them into suites with TestList, and run them with runTestTT, which prints how many cases were tried and how many errors and failures there were; the framework checks results automatically. It comes with a text-based test controller and is designed to be extended.

## Links

- GitHub: https://github.com/hspec/HUnit

## Problems it solves

- write unit tests for my Haskell code
- group Haskell test cases into suites and run them from GHCi
- a simple JUnit-like test framework for Haskell

## Features

- assertEqual, assertBool and other assertions
- named test cases grouped into suites
- runTestTT text runner with counts of errors and failures

## Limitations

- Includes only a text-based test controller[^1]

## Trust

Overall: 0.21 out of 1.
Signals: maintenance 0.06, adoption 0.42, momentum 0.08, community 0.55, backing 0.30, extensibility 0.00.

- 132 GitHub stars
- 23 contributors
- backed by Simon Hengel

Warnings:

- last commit 2.3 years ago

## Alternatives

- [Hspec](https://talira.ai/catalog/hspec-w8wthgqq.md): A testing framework for Haskell with a friendly describe/it DSL
- [tasty](https://talira.ai/catalog/tasty-2v74vhch.md): A modern, extensible testing framework for Haskell

## Sources

[^1]: https://github.com/hspec/HUnit#readme (checked 28 Nov 2026)
[^2]: https://github.com/hspec/HUnit/blob/main/LICENSE (checked 28 Nov 2026)
