Unit Testing in Action

Martin Nowak code at dawg.eu
Mon Oct 23 11:44:32 UTC 2017


On Saturday, 21 October 2017 at 22:50:51 UTC, Walter Bright wrote:
> Coverage would give:
>
> 1|    x = 2;
> 2|    if (x == 1 || x == 2)
>
> I.e. the second line gets an execution count of 2. By contrast,
>
> 1|    x = 1;
> 1|    if (x == 1 || x == 2)

Interesting point, but would likely fail for more complex stuff.

1| stmt;
2| if (api1 == 1 && api2 == 2 ||
        api2 == 2 && api3 == 3)

Anyhow, I think the current state is good enough and there are 
gdc/ldc for further coverage features.



More information about the Digitalmars-d-announce mailing list