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:
Johan Engelen 2017-12-15 00:18:25 +01:00 committed by GitHub
parent acb4c7838c
commit fd009c7434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}