unittest behaviour

Manfred Nowak svv1999 at hotmail.com
Wed Dec 18 14:36:49 UTC 2024


On Tuesday, 17 December 2024 at 21:31:13 UTC, DLearner wrote:

[... environmental requirements]
> I regard that as something that is the programmer's 
> responsibility [perhaps by writing a script that performs those 
> tasks, and calling that script within the unittest].

This holds for the requirments inside the code of the unit too: 
by adding a routine for the preferred re-initialization of the 
unit---wrapped by `version( unittest)'.

For the example presented the line of code
|  version( unittest) var1= 1;
would suffice, if correctly placed into the function.

-manfred


More information about the Digitalmars-d-learn mailing list