Skip to content

Commit e1c42e4

Browse files
Copilotswissspidy
andauthored
Stabilize regex error Behat assertions across PHP/PCRE versions (#239)
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 9e8c417 commit e1c42e4

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

features/search-replace.feature

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,7 @@ Feature: Do global search/replace
507507
"""
508508
preg_match(): Compilation failed:
509509
"""
510-
And STDERR should contain:
511-
"""
512-
at offset 11
513-
"""
510+
And STDERR should match /preg_match\(\): Compilation failed: unmatched (closing parenthesis|parentheses) at offset [0-9]+\.?/
514511
And the return code should be 1
515512

516513
When I try `wp search-replace 'regex error)' '' --regex --regex-flags=u`
@@ -522,10 +519,7 @@ Feature: Do global search/replace
522519
"""
523520
preg_match(): Compilation failed:
524521
"""
525-
And STDERR should contain:
526-
"""
527-
at offset 11
528-
"""
522+
And STDERR should match /preg_match\(\): Compilation failed: unmatched (closing parenthesis|parentheses) at offset [0-9]+\.?/
529523
And the return code should be 1
530524

531525
When I try `wp search-replace 'regex error)' '' --regex --regex-delimiter=/`
@@ -537,10 +531,7 @@ Feature: Do global search/replace
537531
"""
538532
preg_match(): Compilation failed:
539533
"""
540-
And STDERR should contain:
541-
"""
542-
at offset 11
543-
"""
534+
And STDERR should match /preg_match\(\): Compilation failed: unmatched (closing parenthesis|parentheses) at offset [0-9]+\.?/
544535
And the return code should be 1
545536

546537
When I try `wp search-replace 'regex error)' '' --regex --regex-delimiter=/ --regex-flags=u`
@@ -552,10 +543,7 @@ Feature: Do global search/replace
552543
"""
553544
preg_match(): Compilation failed:
554545
"""
555-
And STDERR should contain:
556-
"""
557-
at offset 11
558-
"""
546+
And STDERR should match /preg_match\(\): Compilation failed: unmatched (closing parenthesis|parentheses) at offset [0-9]+\.?/
559547
And the return code should be 1
560548

561549
@require-mysql

0 commit comments

Comments
 (0)