Skip to content

Commit

Permalink
Take bidirectional unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
monarchdodra committed Jan 4, 2014
1 parent 6bf9133 commit e151ccf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions std/range.d
Expand Up @@ -3347,6 +3347,16 @@ unittest
t3 = take(t2, 1);
}

unittest
{
alias R1 = typeof(repeat(1));
alias R2 = typeof(cycle([1]));
alias TR1 = Take!R1;
alias TR2 = Take!R2;
static assert(isBidirectionalRange!TR1);
static assert(isBidirectionalRange!TR2);
}

/**
Similar to $(LREF take), but assumes that $(D range) has at least $(D
n) elements. Consequently, the result of $(D takeExactly(range, n))
Expand Down

0 comments on commit e151ccf

Please sign in to comment.