Merge pull request #5046 from MartinNowak/merge_stable

Merge remote-tracking branch 'upstream/stable' into merge_stable
This commit is contained in:
Walter Bright 2017-01-21 15:45:48 -08:00 committed by GitHub
commit 9f77f47cc7
2 changed files with 22 additions and 4 deletions

View file

@ -2387,6 +2387,11 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR))
else else
_current = _items.front; _current = _items.front;
}; };
this(RoR items, ElementType!RoR current)
{
_items = items;
_current = current;
}
public: public:
this(RoR r) this(RoR r)
{ {
@ -2441,10 +2446,7 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR))
{ {
@property auto save() @property auto save()
{ {
Result copy = this; return Result(_items.save, _current.save);
copy._items = _items.save;
copy._current = _current.save;
return copy;
} }
} }

View file

@ -303,3 +303,19 @@ unittest
assert("abc".matchFirst(r)); assert("abc".matchFirst(r));
assertThrown(regex("(?#...")); assertThrown(regex("(?#..."));
} }
// bugzilla 17066
unittest
{
string message = "fix issue 16319 and fix std.traits.isInnerClass";
static auto matchToRefs(M)(M m)
{
// ctRegex throws a weird error in unittest compilation
enum splitRE = regex(`[^\d]+`);
return m.captures[5].splitter(splitRE);
}
enum issueRE = ctRegex!(`((close|fix|address)e?(s|d)? )` ~
`?(ticket|bug|tracker item|issue)s?:? *([\d ,\+&#and]+)`, "i");
message.matchAll(issueRE).map!matchToRefs.joiner.array;
}