Browse Source

Fix bad test

I added a branch in the test for #72277 to fail if I hit an odd case
while debugging. I then wrote code to handle that case and promptly
forgot about it. But I left the odd case detection branch in! And it's
failing the tests. Sorry! This zaps it. It was just a debugging
leftover.

Closes #72883
Nik Everett 4 years ago
parent
commit
dc5cb4e203

+ 0 - 3
server/src/test/java/org/elasticsearch/common/regex/RegexTests.java

@@ -144,9 +144,6 @@ public class RegexTests extends ESTestCase {
         for (int i = 0; i < 100000; i++) {
             int idx = between(0, Integer.MAX_VALUE);
             String pattern = Integer.toString(idx, Character.MAX_RADIX);
-            if ((pattern.startsWith("foo") && pattern.endsWith("bar")) || (pattern.startsWith("baz") && pattern.endsWith("bort"))) {
-                fail();
-            }
             if (idx < patternCount
                 || (pattern.startsWith("foo") && pattern.endsWith("bar"))  // 948437811
                 || (pattern.startsWith("baz") && pattern.endsWith("bort")) // Can't match, but you get the idea