Skip to content

Commit f70bc27

Browse files
committed
Update test names
1 parent 17b6db2 commit f70bc27

File tree

1 file changed

+8
-4
lines changed
  • x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string

1 file changed

+8
-4
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RLikeTests.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626
import java.util.ArrayList;
2727
import java.util.List;
28+
import java.util.Locale;
2829
import java.util.function.Function;
30+
import java.util.function.Predicate;
2931
import java.util.function.Supplier;
3032

3133
import 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

Comments
 (0)