Skip to content

Commit dfacc4b

Browse files
author
tosite
committed
first comes test.
1 parent d53ae07 commit dfacc4b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

features/search-replace.feature

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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,34 +400,39 @@ 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`
410408
Then STDERR should be:
411409
"""
412410
Error: The regex pattern 'regex error)' with default delimiter 'chr(1)' and no flags fails.
411+
preg_match(): Compilation failed: unmatched parentheses at offset 11.
413412
"""
414413
And the return code should be 1
415414

416415
When I try `wp search-replace 'regex error)' '' --regex --regex-flags=u`
417416
Then STDERR should be:
418417
"""
419418
Error: The regex pattern 'regex error)' with default delimiter 'chr(1)' and flags 'u' fails.
419+
preg_match(): Compilation failed: unmatched parentheses at offset 11.
420420
"""
421421
And the return code should be 1
422422

423423
When I try `wp search-replace 'regex error)' '' --regex --regex-delimiter=/`
424424
Then STDERR should be:
425425
"""
426426
Error: The regex '/regex error)/' fails.
427+
preg_match(): Compilation failed: unmatched parentheses at offset 11.
427428
"""
428429
And the return code should be 1
429430

430431
When I try `wp search-replace 'regex error)' '' --regex --regex-delimiter=/ --regex-flags=u`
431432
Then STDERR should be:
432433
"""
433434
Error: The regex '/regex error)/u' fails.
435+
preg_match(): Compilation failed: unmatched parentheses at offset 11.
434436
"""
435437
And the return code should be 1
436438

0 commit comments

Comments
 (0)