mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 15:10:46 +03:00
Unittest for joiner() with non-forward range
This commit is contained in:
parent
ae3cea46fd
commit
c15062b1e8
1 changed files with 7 additions and 0 deletions
|
@ -2289,6 +2289,13 @@ unittest
|
||||||
"Mary...has...a...little...lamb"));
|
"Mary...has...a...little...lamb"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unittest
|
||||||
|
{
|
||||||
|
// joiner() should work for non-forward ranges too.
|
||||||
|
InputRange!string r = inputRangeObject(["abc", "def"]);
|
||||||
|
assert (equal(joiner(r, "xyz"), "abcxyzdef"));
|
||||||
|
}
|
||||||
|
|
||||||
auto joiner(RoR)(RoR r)
|
auto joiner(RoR)(RoR r)
|
||||||
if (isInputRange!RoR && isInputRange!(ElementType!RoR))
|
if (isInputRange!RoR && isInputRange!(ElementType!RoR))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue