mirror of
https://github.com/dlang/phobos.git
synced 2025-05-01 07:30:33 +03:00
Added unittest related to fix, and moved unittest related to issue to std/algorithm/iterartion.d
This commit is contained in:
parent
41959deae6
commit
d2b8a15e69
2 changed files with 19 additions and 7 deletions
|
@ -771,6 +771,23 @@ private struct MapResult(alias fun, Range)
|
||||||
assert(dd.length == 4);
|
assert(dd.length == 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify fix for: https://issues.dlang.org/show_bug.cgi?id=16034
|
||||||
|
@safe unittest
|
||||||
|
{
|
||||||
|
struct One
|
||||||
|
{
|
||||||
|
int entry = 1;
|
||||||
|
@disable this(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
One[] ones = [One(), One()];
|
||||||
|
|
||||||
|
import std.algorithm.comparison : equal;
|
||||||
|
|
||||||
|
assert(ones.map!`a.entry + 1`.equal([2, 2]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@safe unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
import std.algorithm.comparison : equal;
|
import std.algorithm.comparison : equal;
|
||||||
|
|
|
@ -227,7 +227,7 @@ enum bool isInputRange(R) =
|
||||||
}
|
}
|
||||||
static assert(!isInputRange!VoidFront);
|
static assert(!isInputRange!VoidFront);
|
||||||
}
|
}
|
||||||
// Verify fix for: https://issues.dlang.org/show_bug.cgi?id=16034
|
// https://issues.dlang.org/show_bug.cgi?id=16034
|
||||||
@safe unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
struct One
|
struct One
|
||||||
|
@ -236,12 +236,7 @@ enum bool isInputRange(R) =
|
||||||
@disable this(this);
|
@disable this(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
One[] ones = [One(), One()];
|
assert(isInputRange!(One[]));
|
||||||
|
|
||||||
import std.algorithm.iteration : map;
|
|
||||||
import std.algorithm.comparison : equal;
|
|
||||||
|
|
||||||
assert(ones.map!`a.entry + 1`.equal([2, 2]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@safe unittest
|
@safe unittest
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue