Added unittest related to fix, and moved unittest related to issue to std/algorithm/iterartion.d

This commit is contained in:
james 2022-09-19 22:27:22 +02:00
parent 41959deae6
commit d2b8a15e69
2 changed files with 19 additions and 7 deletions

View file

@ -771,6 +771,23 @@ private struct MapResult(alias fun, Range)
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
{
import std.algorithm.comparison : equal;