mirror of
https://github.com/dlang/phobos.git
synced 2025-05-08 03:56:54 +03:00
Add unittests bug #12889
This commit is contained in:
parent
285d027677
commit
6ff3378c79
2 changed files with 22 additions and 0 deletions
|
@ -8726,6 +8726,19 @@ unittest
|
|||
auto arr = [1,2,3];
|
||||
arr = arr.remove!(SwapStrategy.unstable)(2);
|
||||
assert(arr == [1,2]);
|
||||
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
// Bug# 12889
|
||||
int[1][] arr = [[0], [1], [2], [3], [4], [5], [6]];
|
||||
auto orig = arr.dup;
|
||||
foreach (i; iota(arr.length))
|
||||
{
|
||||
assert(orig == arr.remove!(SwapStrategy.unstable)(tuple(i,i)));
|
||||
assert(orig == arr.remove!(SwapStrategy.stable)(tuple(i,i)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2090,6 +2090,15 @@ unittest
|
|||
assert(a == [1, 4, 5, 5]);
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
// Bug# 12889
|
||||
int[1][] arr = [[0], [1], [2], [3], [4], [5], [6]];
|
||||
int[1][] stuff = [[0], [1]];
|
||||
replaceInPlace(arr, 4, 6, stuff);
|
||||
assert(arr == [[0], [1], [2], [3], [0], [1], [6]]);
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
bool test(T, U, V)(T orig, size_t from, size_t to, U toReplace, V result,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue