Just a small tip for those people, who use following code style:

if( cond ) {
  body
} else {
  body
}

I've found it very convenient to "attach" unittest block to my function declatarions in a same way:

private int find_pos_divisor( int first, int second ) {
    int temp;
    while( second ) {
        temp = second;
        second = first % second;
        first = temp;
    }
    return abs( first );
} unittest {
    assert( find_pos_divisor ( 10, 20 ) == 10 );
    assert( find_pos_divisor ( 10, 0 ) == 10 );
    assert( find_pos_divisor ( 9, 6 ) == 3 );
    assert( find_pos_divisor ( 10, 3 ) == 1 );
}

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?