Discussion Thread: DIP 1039--Static Arrays with Inferred Length--Community Review Round 1

Q. Schroll qs.il.paperinik at gmail.com
Tue Jan 12 23:19:45 UTC 2021


On Tuesday, 12 January 2021 at 20:04:00 UTC, Paul Backus wrote:
> On Tuesday, 12 January 2021 at 19:49:10 UTC, jmh530 wrote:
>> I'd rather put the import at the top of the file, or in a 
>> version(unittest) block than that. The problem with those 
>> approaches is that if you have an example unittest, then when 
>> a user tries to run it then they have to put the import in 
>> themselves.
>
> Seems like the obvious solution is to put the import inside the 
> unittest.

I'd say that example unit tests shouldn't have anything available 
except the current module. That a unittest is just a function is 
wrong in many ways.
By default, it shouldn't have access to imports outside of it and 
it shouldn't have access to non-public (private, package) symbols.


More information about the Digitalmars-d-announce mailing list