https://github.com/csdummi/testhaskell
Small and simple Haskell Testing Framework
https://github.com/csdummi/testhaskell
haskell haskell-simple haskell-tdd tdd
Last synced: 8 months ago
JSON representation
Small and simple Haskell Testing Framework
- Host: GitHub
- URL: https://github.com/csdummi/testhaskell
- Owner: CSDUMMI
- License: mit
- Created: 2018-10-29T16:30:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-30T17:19:35.000Z (over 7 years ago)
- Last Synced: 2025-01-13T16:50:46.363Z (over 1 year ago)
- Topics: haskell, haskell-simple, haskell-tdd, tdd
- Language: Haskell
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TestHaskell
Simple TDD Framework for Haskell.
My first TDD Framework was Jestjs and I still
like the simple Syntax of the expect function
that they used and that made a test much like
native english.
I wanted to port that to Haskell.
## Expect Syntax
The Basic Concept is:
```haskell
expect $ value1 `predicate` value2
```
For example:
```haskell
expect $ 1 `toBe` 0+1
```
if this test passes (as it should) then the program won't give
you any notice of it. But if it would fail as here for example:
```haskell
expect $ 1 `toBeGreaterThen` 2
```
it will print out a message like this:
1 should be greater then 2
every predicate generates such a message and expect will print it out
if the test fails.
## Setup your project for TestHaskell
I don't won't you to transform your whole project
just to use my Framework. Instead you can just copy the
Test.hs file into your own project then
import it to all your test files
and finally write a main that executes all your tests.
For more see sampleTest.hs