2525
2626import java .util .ArrayList ;
2727import java .util .List ;
28+ import java .util .Locale ;
2829import java .util .function .Function ;
30+ import java .util .function .Predicate ;
2931import java .util .function .Supplier ;
3032
3133import static org .elasticsearch .xpack .esql .core .util .TestUtils .randomCasing ;
@@ -99,15 +101,15 @@ private static void casesForString(
99101 String text = textSupplier .get ();
100102 return new TextAndPattern (text , escapeString .apply (text ) + randomAlphaOfLength (1 ));
101103 }, false );
102- cases (cases , title + " doesn't match self with trailing" , () -> {
104+ cases (cases , title + " doesn't match self with trailing case insensitive " , () -> {
103105 String text = textSupplier .get ();
104106 return new TextAndPattern (randomCasing (text ), escapeString .apply (text ) + randomAlphaOfLength (1 ));
105107 }, true , false );
106108 cases (cases , title + " matches self with optional trailing" , () -> {
107109 String text = randomAlphaOfLength (1 );
108110 return new TextAndPattern (text , escapeString .apply (text ) + optionalPattern .get ());
109111 }, true );
110- cases (cases , title + " matches self with optional trailing" , () -> {
112+ cases (cases , title + " matches self with optional trailing case insensitive " , () -> {
111113 String text = randomAlphaOfLength (1 );
112114 return new TextAndPattern (randomCasing (text ), escapeString .apply (text ) + optionalPattern .get ());
113115 }, true , true );
@@ -117,9 +119,11 @@ private static void casesForString(
117119 String different = escapeString .apply (randomValueOtherThan (text , textSupplier ));
118120 return new TextAndPattern (text , different );
119121 }, false );
120- cases (cases , title + " doesn't match different" , () -> {
122+ cases (cases , title + " doesn't match different case insensitive " , () -> {
121123 String text = textSupplier .get ();
122- String different = escapeString .apply (randomValueOtherThan (text , textSupplier ));
124+ Predicate <String > predicate = t -> t .toLowerCase (Locale .ROOT ).equals (text .toLowerCase (Locale .ROOT ));
125+ String different = escapeString .apply (randomValueOtherThanMany (predicate , textSupplier ));
126+ System .err .println ("XXX text=" + text + " different=" + different );
123127 return new TextAndPattern (text , different );
124128 }, true , false );
125129 }
0 commit comments