Testing Guidelines
Frost uses Hspec with Hspec Discover for its testing framework. This approach provides a structured and expressive way to write and organize tests for the Frost compiler.
Hspec is a popular testing framework for Haskell that allows developers to write human-readable specifications of their code's behavior. Hspec Discover is an extension that automatically finds and runs all test files in a project, simplifying test organization and execution.
To use Hspec with Hspec Discover in Frost:
Test files are placed in the
test/
directory, mirroring the structure of thelib/
directory.Each test file should end with
Spec.hs
, for example:A main test file (
Spec.hs
) in thetest/
directory uses Hspec Discover:Individual test files use Hspec to describe and test specific components:
Run tests using
cabal test
, which will automatically discover and execute all test specs.
This setup allows for organized, maintainable, and easily extensible tests as the Frost compiler evolves.
Last updated