extra test to make sure stable sort of non-lvalue ranges compiles & works

This commit is contained in:
Dmitry Olshansky 2012-11-23 23:51:32 +04:00
parent dca2a007a2
commit 3aa8e20371

View file

@ -8295,6 +8295,17 @@ unittest
}
unittest
{
//test stable sort + zip
auto x = [10, 50, 60, 60, 20];
dchar[] y = "abcde"d.dup;
sort!("a[0] < b[0]", SwapStrategy.stable)(zip(x, y));
assert(x == [10, 20, 50, 60, 60]);
assert(y == "aebcd"d);
}
// schwartzSort
/**
Sorts a range using an algorithm akin to the $(WEB