Skip to content

Apache Lucene open-source search software

make TestRegexpRandom2 harder

Robert Muirfa6709517cc8
diff --git a/lucene/src/test/org/apache/lucene/util/automaton/AutomatonTestUtil.java b/lucene/src/test/org/apache/lucene/util/automaton/AutomatonTestUtil.java
index 9f7087ff78c..aeb8d86d399 100644
--- a/lucene/src/test/org/apache/lucene/util/automaton/AutomatonTestUtil.java
+++ b/lucene/src/test/org/apache/lucene/util/automaton/AutomatonTestUtil.java
@@ -55,7 +55,7 @@ public class AutomatonTestUtil {
}
final char[] buffer = new char[end];
for (int i = 0; i < end; i++) {
- int t = r.nextInt(11);
+ int t = r.nextInt(15);
if (0 == t && i < end - 1) {
// Make a surrogate pair
// High surrogate
@@ -73,6 +73,10 @@ public class AutomatonTestUtil {
else if (8 == t) buffer[i] = '+';
else if (9 == t) buffer[i] = '(';
else if (10 == t) buffer[i] = ')';
+ else if (11 == t) buffer[i] = '-';
+ else if (12 == t) buffer[i] = '[';
+ else if (13 == t) buffer[i] = ']';
+ else if (14 == t) buffer[i] = '|';
}
return new String(buffer, 0, end);
}