mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 15:10:46 +03:00
Add @nogc annotated unittest for std.algorithm.remove
This commit is contained in:
parent
07d4c37229
commit
99b74fb962
1 changed files with 12 additions and 0 deletions
|
@ -1944,6 +1944,18 @@ if (isBidirectionalRange!Range
|
|||
[ 1, 3, 3, 4, 5, 5, 6 ]);
|
||||
}
|
||||
|
||||
@nogc unittest
|
||||
{
|
||||
// @nogc test
|
||||
int[10] arr = [0,1,2,3,4,5,6,7,8,9];
|
||||
alias pred = e => e < 5;
|
||||
|
||||
auto r = arr[].remove!(SwapStrategy.unstable)(0);
|
||||
r = r.remove!(SwapStrategy.stable)(0);
|
||||
r = r.remove!(pred, SwapStrategy.unstable);
|
||||
r = r.remove!(pred, SwapStrategy.stable);
|
||||
}
|
||||
|
||||
@safe unittest
|
||||
{
|
||||
import std.algorithm.comparison : min;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue