unit-threaded v0.6.26 - advanced unit testing in D with new features

Atila Neves via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Aug 8 00:37:19 PDT 2016


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


More information about the Digitalmars-d-announce mailing list