mirror of
https://github.com/dlang/phobos.git
synced 2025-05-12 15:17:12 +03:00
Merge pull request #5657 from DmitryOlshansky/issue-17668
Fix issue 17668 - assert failure regex(q"<[^]>") merged-on-behalf-of: Dmitry Olshansky <DmitryOlshansky@users.noreply.github.com>
This commit is contained in:
commit
bcb17a6d88
2 changed files with 9 additions and 0 deletions
|
@ -1304,6 +1304,7 @@ if (isForwardRange!R && is(ElementType!R : dchar))
|
|||
switch (op)
|
||||
{
|
||||
case Operator.Negate:
|
||||
enforce(!stack.empty, "no operand for '^'");
|
||||
stack.top = stack.top.inverted;
|
||||
break;
|
||||
case Operator.Union:
|
||||
|
|
|
@ -1098,3 +1098,11 @@ alias Sequence(int B, int E) = staticIota!(B, E);
|
|||
willThrow([r"[a-\", r"123"], "invalid escape sequence");
|
||||
willThrow([r"\", r"123"], "invalid escape sequence");
|
||||
}
|
||||
|
||||
// bugzilla 17668
|
||||
@safe unittest
|
||||
{
|
||||
import std.algorithm.searching;
|
||||
auto e = collectException!RegexException(regex(q"<[^]>"));
|
||||
assert(e.msg.canFind("no operand for '^'"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue