@@ -195,13 +195,10 @@ Feature: Do global search/replace
195195 Scenario : Regex search/replace with a incorrect `--regex-flags`
196196 Given a WP install
197197 When I try `wp search-replace '(Hello)\s (world)' '$2, $1' --regex --regex-flags='kppr' `
198- Then STDERR should contain:
199- """
200- (Hello)\s(world)
201- """
202- And STDERR should contain:
198+ Then STDERR should be:
203199 """
204- kppr
200+ Error: The regex pattern '(Hello)\s(world)' with default delimiter 'chr(1)' and flags 'kppr' fails.
201+ preg_match(): Unknown modifier 'k'.
205202 """
206203 And the return code should be 1
207204
@@ -403,35 +400,68 @@ Feature: Do global search/replace
403400 Then STDERR should be:
404401 """
405402 Error: The regex '1HTTP://EXAMPLE.COM1i' fails.
403+ preg_match(): Delimiter must not be alphanumeric or backslash.
406404 """
407405 And the return code should be 1
408406
409407 When I try `wp search-replace 'regex error)' '' --regex`
410- Then STDERR should be :
408+ Then STDERR should contain :
411409 """
412410 Error: The regex pattern 'regex error)' with default delimiter 'chr(1)' and no flags fails.
413411 """
412+ And STDERR should contain:
413+ """
414+ preg_match(): Compilation failed:
415+ """
416+ And STDERR should contain:
417+ """
418+ at offset 11
419+ """
414420 And the return code should be 1
415421
416422 When I try `wp search-replace 'regex error)' '' --regex --regex-flags=u`
417- Then STDERR should be :
423+ Then STDERR should contain :
418424 """
419425 Error: The regex pattern 'regex error)' with default delimiter 'chr(1)' and flags 'u' fails.
420426 """
427+ And STDERR should contain:
428+ """
429+ preg_match(): Compilation failed:
430+ """
431+ And STDERR should contain:
432+ """
433+ at offset 11
434+ """
421435 And the return code should be 1
422436
423437 When I try `wp search-replace 'regex error)' '' --regex --regex-delimiter=/`
424- Then STDERR should be :
438+ Then STDERR should contain :
425439 """
426440 Error: The regex '/regex error)/' fails.
427441 """
442+ And STDERR should contain:
443+ """
444+ preg_match(): Compilation failed:
445+ """
446+ And STDERR should contain:
447+ """
448+ at offset 11
449+ """
428450 And the return code should be 1
429451
430452 When I try `wp search-replace 'regex error)' '' --regex --regex-delimiter=/ --regex-flags=u`
431- Then STDERR should be :
453+ Then STDERR should contain :
432454 """
433455 Error: The regex '/regex error)/u' fails.
434456 """
457+ And STDERR should contain:
458+ """
459+ preg_match(): Compilation failed:
460+ """
461+ And STDERR should contain:
462+ """
463+ at offset 11
464+ """
435465 And the return code should be 1
436466
437467 Scenario : Formatting as count-only
0 commit comments