@@ -195,13 +195,10 @@ Feature: Do global search/replace
195
195
Scenario : Regex search/replace with a incorrect `--regex-flags`
196
196
Given a WP install
197
197
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:
203
199
"""
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'.
205
202
"""
206
203
And the return code should be 1
207
204
@@ -403,35 +400,68 @@ Feature: Do global search/replace
403
400
Then STDERR should be:
404
401
"""
405
402
Error: The regex '1HTTP://EXAMPLE.COM1i' fails.
403
+ preg_match(): Delimiter must not be alphanumeric or backslash.
406
404
"""
407
405
And the return code should be 1
408
406
409
407
When I try `wp search-replace 'regex error)' '' --regex`
410
- Then STDERR should be :
408
+ Then STDERR should contain :
411
409
"""
412
410
Error: The regex pattern 'regex error)' with default delimiter 'chr(1)' and no flags fails.
413
411
"""
412
+ And STDERR should contain:
413
+ """
414
+ preg_match(): Compilation failed:
415
+ """
416
+ And STDERR should contain:
417
+ """
418
+ at offset 11
419
+ """
414
420
And the return code should be 1
415
421
416
422
When I try `wp search-replace 'regex error)' '' --regex --regex-flags=u`
417
- Then STDERR should be :
423
+ Then STDERR should contain :
418
424
"""
419
425
Error: The regex pattern 'regex error)' with default delimiter 'chr(1)' and flags 'u' fails.
420
426
"""
427
+ And STDERR should contain:
428
+ """
429
+ preg_match(): Compilation failed:
430
+ """
431
+ And STDERR should contain:
432
+ """
433
+ at offset 11
434
+ """
421
435
And the return code should be 1
422
436
423
437
When I try `wp search-replace 'regex error)' '' --regex --regex-delimiter=/`
424
- Then STDERR should be :
438
+ Then STDERR should contain :
425
439
"""
426
440
Error: The regex '/regex error)/' fails.
427
441
"""
442
+ And STDERR should contain:
443
+ """
444
+ preg_match(): Compilation failed:
445
+ """
446
+ And STDERR should contain:
447
+ """
448
+ at offset 11
449
+ """
428
450
And the return code should be 1
429
451
430
452
When I try `wp search-replace 'regex error)' '' --regex --regex-delimiter=/ --regex-flags=u`
431
- Then STDERR should be :
453
+ Then STDERR should contain :
432
454
"""
433
455
Error: The regex '/regex error)/u' fails.
434
456
"""
457
+ And STDERR should contain:
458
+ """
459
+ preg_match(): Compilation failed:
460
+ """
461
+ And STDERR should contain:
462
+ """
463
+ at offset 11
464
+ """
435
465
And the return code should be 1
436
466
437
467
Scenario : Formatting as count-only
0 commit comments