digitalmars.D - Documentation unittests are seriously awesome
- Nick Sabalausky (13/13) Sep 23 2016 Just had to say it. Been using it a lot this week.
- H. S. Teoh via Digitalmars-d (5/22) Sep 23 2016 +1, yep, I love it too. This is one of D's underrated killer features.
- Andrei Alexandrescu (2/15) Sep 23 2016 We owe this to Andrej Mitrovic IIRC! -- Andrei
- H. S. Teoh via Digitalmars-d (5/25) Sep 25 2016 Yes, we do.
- Anonymouse (5/18) Sep 26 2016 ELI5 please. What does this do and how is it different from
- Biotronic (10/32) Sep 26 2016 Not just together. The code in the unittest block is included
Just had to say it. Been using it a lot this week. Referring to this stuff: ---------------------------- /// Does foo stuff void foo() {} /// unittest { // Tests and docs in one, 2-for-1 win! } ---------------------------- And all just built-in. Freaking sweet.
Sep 23 2016
On Fri, Sep 23, 2016 at 04:42:26PM -0400, Nick Sabalausky via Digitalmars-d wrote:Just had to say it. Been using it a lot this week. Referring to this stuff: ---------------------------- /// Does foo stuff void foo() {} /// unittest { // Tests and docs in one, 2-for-1 win! } ---------------------------- And all just built-in. Freaking sweet.+1, yep, I love it too. This is one of D's underrated killer features. T -- Life is complex. It consists of real and imaginary parts. -- YHL
Sep 23 2016
On 09/23/2016 04:42 PM, Nick Sabalausky wrote:Just had to say it. Been using it a lot this week. Referring to this stuff: ---------------------------- /// Does foo stuff void foo() {} /// unittest { // Tests and docs in one, 2-for-1 win! } ---------------------------- And all just built-in. Freaking sweet.We owe this to Andrej Mitrovic IIRC! -- Andrei
Sep 23 2016
On Fri, Sep 23, 2016 at 08:32:00PM -0400, Andrei Alexandrescu via Digitalmars-d wrote:On 09/23/2016 04:42 PM, Nick Sabalausky wrote:Yes, we do. T -- Дерево держится корнями, а человек - друзьями.Just had to say it. Been using it a lot this week. Referring to this stuff: ---------------------------- /// Does foo stuff void foo() {} /// unittest { // Tests and docs in one, 2-for-1 win! } ---------------------------- And all just built-in. Freaking sweet.We owe this to Andrej Mitrovic IIRC! -- Andrei
Sep 25 2016
On Friday, 23 September 2016 at 20:42:26 UTC, Nick Sabalausky wrote:Just had to say it. Been using it a lot this week. Referring to this stuff: ---------------------------- /// Does foo stuff void foo() {} /// unittest { // Tests and docs in one, 2-for-1 win! } ---------------------------- And all just built-in. Freaking sweet.ELI5 please. What does this do and how is it different from normal practice? (I assume having the docs together with the tests is what's special here.)
Sep 26 2016
On Monday, 26 September 2016 at 09:35:32 UTC, Anonymouse wrote:On Friday, 23 September 2016 at 20:42:26 UTC, Nick Sabalausky wrote:Not just together. The code in the unittest block is included verbatim in the documentation. Basically, it's executable documentation. :p This ensures the documentation is up-to-date (otherwise, the unittests fail) and makes it easy to write documentation since you're going to write tests anyway (You are going to write tests anyway, right? Right?). -- BiotronicJust had to say it. Been using it a lot this week. Referring to this stuff: ---------------------------- /// Does foo stuff void foo() {} /// unittest { // Tests and docs in one, 2-for-1 win! } ---------------------------- And all just built-in. Freaking sweet.ELI5 please. What does this do and how is it different from normal practice? (I assume having the docs together with the tests is what's special here.)
Sep 26 2016