Just a small tip for those people, who use following code style:<div><br></div><div>if( cond ) {</div><div>  body</div><div>} else {</div><div>  body</div><div>}</div><div><br></div><div>I've found it very convenient to "attach" unittest block to my function declatarions in a same way:</div>
<div><br></div><div><div>private int find_pos_divisor( int first, int second ) {</div><div>    int temp;</div><div>    while( second ) {</div><div>        temp = second;</div><div>        second = first % second;</div><div>
        first = temp;</div><div>    }</div><div>    return abs( first );</div><div>} unittest {</div><div>    assert( find_pos_divisor ( 10, 20 ) == 10 );</div><div>    assert( find_pos_divisor ( 10, 0 ) == 10 );</div><div>
    assert( find_pos_divisor ( 9, 6 ) == 3 );</div><div>    assert( find_pos_divisor ( 10, 3 ) == 1 );</div><div>}</div></div><div><br></div><div>Looks as a natural extension to the declaration, and helps to keep all related code in one place. Did anyone found out any more convenient D-specific conventions?</div>