qcheck ~master
A library for automatic randomized testing.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
qcheck
A library for automatic random testing, inspired by Haskell's excellent QuickCheck.
Documentation
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])();
}
- ~master released 6 years ago
- MartinNowak/qcheck
- MIT
- Copyright © 2010-, Martin Nowak
- Authors:
- Dependencies:
- none
- Versions:
-
0.1.1 2018-Jan-31 0.1.0 2014-Oct-14 ~master 2018-Jan-31 ~testBeta 2015-Sep-13 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
231 downloads total
-
- Score:
- 1.0
- Short URL:
- qcheck.dub.pm