mirror of
https://github.com/dlang/phobos.git
synced 2025-05-04 09:00:22 +03:00
extra test to make sure stable sort of non-lvalue ranges compiles & works
This commit is contained in:
parent
dca2a007a2
commit
3aa8e20371
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue