If I have an external test runner, can I get visibility up internal types only for version(unittest) ?

aliak something at something.com
Sat Sep 1 21:05:34 UTC 2018


mypackage:

internaltype.d
   package struct InternalType {}
   package template isInternalType(T) { ... }
externaltype.d
   auto doStuff() {
     return InternalType();
   }


testfile.d
@("Make sure under scenario X that InternalType is returned")
unittest {
   static assert(isInternalType!(typeof(doStuff()));
}

I could've used version to do this maybe? but it doesn't seem to 
work because I tested it by doing:

internaltype.d

version(unittest) {
  package:
}
struct InternalType {
  ...
}
template isInternalType(T) { ... }

And using isInternalType in testfile.d does not seem to issue the 
warning:

Deprecation: internaltype.isInternalType(T) is not visible from 
module testfile

Is there anyway to get visibility of internal types in test files.

Cheers,
- Ali


More information about the Digitalmars-d-learn mailing list