September 01, 2018 If I have an external test runner, can I get visibility up internal types only for version(unittest) ? | ||||
---|---|---|---|---|
| ||||
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 |
Copyright © 1999-2021 by the D Language Foundation