Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.08 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.08 KB

qcheck Build Status Coverage Dub

A library for automatic random testing, inspired by Haskell's excellent QuickCheck.

Example Usage

int[] mysort(int[] arr)
{
    // ...
    return arr;
}

unittest
{
    import qcheck;
    import std.algorithm;

    quickCheck!((int[] a) => mysort(a.dup).equal(a.sort()));
}

Generate Random data

The library can also just be used to generate random data, see getArbitrary.

unittest
{
    import qcheck.arbitrary;

    auto sarray = getArbitrary!(int[4])();
    auto array = getArbitrary!(float[])();
    auto aarray = getArbitrary!(int[string])();
}