September 01, 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