Let's bikeshed std.experimental.testing assertions/checks/whatchamacallits

Sebastiaan Koppe via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 30 09:03:45 PDT 2015


On Tuesday, 30 June 2015 at 14:58:45 UTC, Atila Neves wrote:
> On Tuesday, 30 June 2015 at 12:42:40 UTC, Sebastiaan Koppe 
> wrote:
>> On Tuesday, 30 June 2015 at 08:06:37 UTC, Atila Neves wrote:
>>> [...]
>>
>> These days I am leaning towards BDD, but everybody has his 
>> favorite. Maybe just providing the low-level details in 
>> std.testing would enough; e.g. a test runner, UDA's and 
>> assertions.
>>
>
> Yeah, I'm starting to think it might be better to delete 
> `should.d` from my current PR, try to get the rest approved 
> then work on where the community wants the fancy assertions to 
> go. It's a shame though because I think it's a massively 
> important piece of the whole thing. It's a night and day 
> difference when a test fails.
>
> Atila

Makes sense. You could still keep the should's, just rename the 
whole lot to isEmpty / isNotEmpty / isGreaterThan and have it 
return a bool instead of calling fail internally. Then you would 
simply expect the callee to do that. As in: 
`assert(5.isEqual(6));`.


More information about the Digitalmars-d mailing list