On 08/08/2016 08:37, Atila Neves wrote:
On Saturday, 6 August 2016 at 10:34:52 UTC, Nicholas Wilson wrote:
On Friday, 5 August 2016 at 15:31:34 UTC, Atila Neves wrote:
https://code.dlang.org/packages/unit-threaded
What's new:
. Mocking support. Classes, interfaces and structs can be mocked (see
README.md or examples)
. Shrinking support for property-based testing, but only for
integrals and arrays
. Bug fixes
Enjoy!
Atila
There is a typo in your readme
int adder(int i, int j) { return i + j; }
@("Test adder") unittest {
> adder(2 + 3).shouldEqual(5);
}
@("Test adder fails", ShouldFail) unittest {
adder(2 + 3).shouldEqual(7);
}
shouldBe (!) adder(2, 3)
No, turns out it was right after all. There's a `ShouldFail` UDA on that
test.
Atila
But you are passing the expression (2 + 3), rather than a tuple of
arguments (2, 3)!
A...