unittest "name" {}

ProtectAndHide ProtectAndHide at gmail.com
Thu Feb 16 23:48:09 UTC 2023


On Thursday, 16 February 2023 at 23:33:51 UTC, ProtectAndHide 
wrote:
>
> If one wants to identify the purpose of a particular unittest, 
> then naming it makes sense.
>
> Searching for some attribute within the unittest itself (e.g 
> onFailure("...")) is not the correct approach to solving this 
> particular problem.
>
> Imagine your suggested approach as being the approach for a 
> type, such as:
>
> class()
> {
>   classID := "This class is for the purposes of creating a car 
> object";
> }
>
> No. I prefer to name my class.
>
> I'd prefer to name my unittest also.

And the naming convention for a unittest should be just as 
straight forward.

ie. the same as for a class/variable.

There is no need to allow spaces (for example). Of you need a 
sentence to describe your unittest, that is more about 
documentation, than naming something.

unittest testThisClass
{

}

unittest testThatClass
{

}



More information about the Digitalmars-d mailing list