unit test that show more than one failure

Luis luis.panadero at gmail.com
Tue Jun 16 07:39:20 UTC 2020


On Tuesday, 16 June 2020 at 06:19:51 UTC, Joel wrote:
> I've tired different unit test libraries, but they jump out on 
> errors instead of just adding to failed numbers.
>
> I'm thinking like this:
>
> ```
> @("dummy");
> unittset {
>   0.shouldEqual(0);
>   1.shouldEqual(2);
>   2.shouldEqual(3);
> }
> ```
>
> Test: dummy
> test passed line 10: 0 is equal to 0
> test failed line 11: 1 is not equal to 2
> test failed line 12: 2 is not equal to 3
>
> 1 passed
> 2 failed
>
> The unit tests I tried would jump out on the first failure.

I understand that where the trivial test code is placed, must be 
something more complex being tested.

@("dummy test 1");
unittest {
    /// Some test code that runs fine
}

@("dummy test 2");
unittest {
    /// Some test code that fails
}

@("dummy test 3");
unittest {
    /// Some test code that runs fine
}

Does (with Silly) :

✓ app dummy test 1
✗ app dummy test 2
✓ app dummy test 3

Summary: 2 passed, 1 failed in XX ms


If you literary expects that some test runner do what you 
write... sorry but you will never find it on ANY language (that I 
know).




More information about the Digitalmars-d-learn mailing list