You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/db-search.feature
+52-4Lines changed: 52 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -613,6 +613,8 @@ Feature: Search through the database
613
613
Scenario: Search with multibyte strings
614
614
Given a WP install
615
615
And I run `wp option update multibytetest 'あいうえおかきくけこさしすせとたちつてと'`
616
+
# Note ö is o with combining umlaut.
617
+
And I run `wp option update plaintst_combining 'lllllムnöppppp'`
616
618
617
619
When I run `wp db search "かきくけこ" --before_context=0 --after_context=0`
618
620
Then STDOUT should contain:
@@ -647,6 +649,38 @@ Feature: Search through the database
647
649
:あいうえおかきくけこさしすせとたちつてと
648
650
"""
649
651
652
+
When I run `wp db search 'ppppp' --before_context=3 --after_context=4`
653
+
Then STDOUT should contain:
654
+
"""
655
+
:ムnöppppp
656
+
"""
657
+
658
+
When I run `wp db search 'ppppp' --before_context=1 --after_context=1`
659
+
Then STDOUT should contain:
660
+
"""
661
+
:öppppp
662
+
"""
663
+
664
+
When I run `wp db search 'ムn' --before_context=2 --after_context=1`
665
+
Then STDOUT should contain:
666
+
"""
667
+
:llムnö
668
+
"""
669
+
And STDOUT should not contain:
670
+
"""
671
+
:llムnöp
672
+
"""
673
+
674
+
When I run `wp db search 'ムn' --before_context=2 --after_context=2`
675
+
Then STDOUT should contain:
676
+
"""
677
+
:llムnöp
678
+
"""
679
+
And STDOUT should not contain:
680
+
"""
681
+
:llムnöpp
682
+
"""
683
+
650
684
Scenario: Search with regular expressions
651
685
Given a WP install
652
686
And I run `wp option update regextst '12345é789あhttps://regextst.com1234567890123456789éhttps://regextst.com12345678901234567890regextst.com34567890t.com67890'`
@@ -714,15 +748,19 @@ Feature: Search through the database
714
748
https://r
715
749
"""
716
750
717
-
# Bug: context counts combining characters as 2 characters.
718
751
When I run `wp db search 'ppppp' --regex --before_context=3 --after_context=4`
719
752
Then STDOUT should contain:
720
753
"""
721
-
:nöppppp
754
+
:ムnöppppp
722
755
"""
723
756
724
-
# Bug: context counts combining characters as 2 characters.
725
-
When I run `wp db search 'ムn' --regex --before_context=2 --after_context=2`
757
+
When I run `wp db search 'ppppp' --regex --before_context=1 --after_context=1`
758
+
Then STDOUT should contain:
759
+
"""
760
+
:öppppp
761
+
"""
762
+
763
+
When I run `wp db search 'ムn' --before_context=2 --after_context=1`
726
764
Then STDOUT should contain:
727
765
"""
728
766
:llムnö
@@ -732,6 +770,16 @@ Feature: Search through the database
732
770
:llムnöp
733
771
"""
734
772
773
+
When I run `wp db search 'ムn' --regex --before_context=2 --after_context=2`
774
+
Then STDOUT should contain:
775
+
"""
776
+
:llムnöp
777
+
"""
778
+
And STDOUT should not contain:
779
+
"""
780
+
:llムnöpp
781
+
"""
782
+
735
783
When I run `wp db search 't\.c' --regex --before_context=1 --after_context=1`
0 commit comments