[Haskell-cafe] ANNOUNCE: doctest-0.3.0
simon.hengel at wiktory.org
Thu Jun 16 20:22:16 CEST 2011
I just uploaded a new version of doctest to Hackage.
WHAT IS doctest?
doctest is a port of Python's doctest to Haskell. It can be used to
verify, that examples in Haddock comments do still work. This also
provides you with a simple mechanism to write unit test, without the
burden of maintaining a dedicated test suite.
A basic example of usage is at .
WHAT'S NEW IN THIS VERSION?
It is now possible to intersperse comments between a longer, continuing
example. All examples within the same comment now share a namespace.
The following now works :
-- | Calculate Fibonacci number of given 'Num'.
-- First let's set `n` to ten:
-- >>> let n = 10
-- And now calculate the 10th Fibonacci number:
-- >>> fib n
fib :: Integer -> Integer
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
Thanks to Sakari Jokinen for this contribution!
In addition I changed the name from DocTest to doctest. I think using
all lower-case package names is a good thing. And as we will use
doctest as a library in the near future, this was the last chance for
More information about the Haskell-Cafe