saem / quickcheck

πŸ”Ž Effortless property-based, type-based testing for Nim.

Home Page:https://github.com/schneiderfelipe/quickcheck

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

References

About

πŸ”Ž Effortless property-based, type-based testing for Nim.

https://github.com/schneiderfelipe/quickcheck

License:MIT License


Languages

Language:Nim 100.0%