mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 22:21:09 +03:00
Expand topN testcase
Passing the comparison operation as string "a < b" is tested a few lines up. This adds a test for passing a lambda function.
This commit is contained in:
parent
acb4c7838c
commit
fd009c7434
1 changed files with 1 additions and 1 deletions
|
@ -3137,7 +3137,7 @@ if (isRandomAccessRange!(Range) && hasLength!Range && hasSlicing!Range)
|
|||
topN!"a < b"(v, 100);
|
||||
assert(v == [ 25, 7, 9, 2, 0, 5, 21 ]);
|
||||
auto n = 4;
|
||||
topN!"a < b"(v, n);
|
||||
topN!((a, b) => a < b)(v, n);
|
||||
assert(v[n] == 9);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue