3 ms·
Sounds like an interesting idea. Reminds me a little of doctests in Python. This can also be applied to languages and compilers that do not allow the tests to
by kwhitefoot 9y ago
Sounds like an interesting idea. Reminds me a little of doctests in Python. This can also be applied to languages and compilers that do not allow the tests to run at compile time by wrapping the tests in #If DEBUG ... #End If or whatever the construct is in the language to compile the tests in debug mode only. Or define a special symbol WITHTESTS.
Then at least your tests will be close by the code that they are testing and they won't affect the size of the delivered binary.
- billsix 9y agoThanks for the reference on doctests. I encourage the collocation of tests with procedures in every language, but I personally doubt the efficacy of pound defines. Assert macros are great, but how can a programmer guarantee that they are ever even invoked? "mo' tests mo' problems" -Sean 'puff daddy" Combs.