add test for Issue 16413

This commit is contained in:
John Colvin 2016-08-27 15:06:22 +01:00
parent 9abe256cab
commit 7c7af21d48

View file

@ -999,6 +999,14 @@ private void multiSortImpl(Range, SwapStrategy ss, funs...)(Range r)
assert(arr == [[1, 0], [1, 1], [1, 2], [2, 0]]);
}
unittest //Issue 16413 - @system comparison function
{
bool lt(int a, int b) { return a < b; } static @system
auto a = [2, 1];
a.multiSort!(lt, lt);
assert(a == [1, 2]);
}
private size_t getPivot(alias less, Range)(Range r)
{
import std.algorithm.mutation : swapAt;