Unit tests, asserts and contradictions in the spec

Atila Neves atila.neves at gmail.com
Fri Feb 8 15:03:05 UTC 2019


On Friday, 8 February 2019 at 13:48:19 UTC, Jonathan M Davis 
wrote:
> On Friday, February 8, 2019 3:04:35 AM MST John Colvin via 
> Digitalmars-d wrote:
>> On Thursday, 7 February 2019 at 18:06:24 UTC, H. S. Teoh wrote:
>> > On Thu, Feb 07, 2019 at 04:49:38PM +0000, John Colvin via 
>> > Digitalmars-d wrote: [...]
>> >

> [...]

> In general, I don't think that this is a good way to write 
> tests, but it _can_ reduce how long your tests take, and I've

To me the easiest way to do that is to not talk to a real 
database except in integration/E2E tests and not have too many of 
those.

> IIRC, in the past, there was some discussion of running 
> unittest blocks in parallel, but it was quickly determined that 
> if we were going to do something like that, we'd need a way 
> either to enforce that certain tests not be run in parallel or 
> to mark them so that they would be run in parallel, because the 
> odds were too high that someone out there was writing tests 
> that required that the unittest blocks be run in order and not 
> in parallel.

https://github.com/atilaneves/unit-threaded/blob/183a8cd4d3e271d750e40321ade234ed78554730/subpackages/runner/source/unit_threaded/runner/attrs.d#L10

I always feel dirty when I have to use it, though.


More information about the Digitalmars-d mailing list