3 ms·
Testing code requires executing it. This is true for compile-time code or run-time code.
by SubjectToChange 5y ago
Testing code requires executing it. This is true for compile-time code or run-time code.
- WalterBright 5y agoQuite a lot of the tests in the D compiler suite are compile time only. It makes for running the test suite much faster. To test ImportC, which inherits D's ability to execute functions at compile time, I've been using a lot of _Static_assert() constructs. https://github.com/dlang/dmd/blob/a5b16bd8e72a447d509cca862e2ac8ad3353ee43/test/compilable/testcstuff1.c#L131 https://github.com/dlang/dmd/blob/a5b16bd8e72a447d509cca862e...