Is phobos too fluffy?
johan_forsberg_86 at hotmail.com
Sat Sep 19 09:15:01 UTC 2020
On Saturday, 19 September 2020 at 06:59:54 UTC, Jonathan M Davis
> On Friday, September 18, 2020 6:05:39 AM MDT Imperatorn via
> Digitalmars-d wrote:
>> On Friday, 18 September 2020 at 07:41:25 UTC, mw wrote:
>> > On Friday, 18 September 2020 at 06:50:48 UTC, Imperatorn
> No. It's very common practice in D code to put the tests
> immediately after the code that they're testing. It makes it
> far easier to make sure that everything has tests as well
> making it easier to maintain the code and ensure that the code
> and tests are properly in sync. In addition to that, if a
> unittest block immediately after a symbol is marked with a ddoc
> comment, then it gets added to the documentation for that
> symbol, making it easy to add examples to the documentation and
> have those examples be tested whenever you run the unit tests
> without having to duplicate the examples and worry about
> whether they're in sync between the documentation and the tests.
> - Jonathan M Davis
"It's very common practice"
Actually no it is not. D is the only example I've seen that
routinely does this. Virtually all other languages separate code
More information about the Digitalmars-d