quickcheck
Property-based, type-based testing for Nim.
import unittest, quickcheck, algorithm
test "some invariants of the `reversed` function":
check satisfy do (xs: string) -> bool:
xs.reversed.reversed == xs
check satisfy do (xs, ys: string) -> bool:
(xs & ys).reversed == ys.reversed & xs.reversed
+++ OK, passed 100 quick checks.
+++ OK, passed 100 quick checks.
[OK] some invariants of the `reversed` function
It works with unittest
, as a
standalone library (and probably with testament
) and is inspired by
QuickCheck and
SmallCheck (see below).
Inspiring projects
- QuickCheck (Haskell)
- SmallCheck (Haskell)