Fix intopic predicate with regex
There were many changes in the topic predicate since the last time it worked with regex but the first change that introduced this regression is Ifdb12319. It changed the topic field from exact match to prefix which broke the regex search. Bug: Issue 5759 Change-Id: Ifa35083c5802c3cb980a58c035ff4f8efd9fac7b
This commit is contained in:
parent
15e9a266b3
commit
37b9293dca
@ -26,7 +26,7 @@ class RegexTopicPredicate extends RegexPredicate<ChangeData> {
|
||||
private final RunAutomaton pattern;
|
||||
|
||||
RegexTopicPredicate(Schema<ChangeData> schema, String re) {
|
||||
super(FuzzyTopicPredicate.topicField(schema), re);
|
||||
super(ExactTopicPredicate.topicField(schema), re);
|
||||
|
||||
if (re.startsWith("^")) {
|
||||
re = re.substring(1);
|
||||
|
@ -542,6 +542,8 @@ public abstract class AbstractQueryChangesTest {
|
||||
assertQuery("intopic:fixup", change4);
|
||||
assertQuery("topic:\"\"", change5);
|
||||
assertQuery("intopic:\"\"", change5);
|
||||
assertQuery("intopic:^feature2.*", change4, change2);
|
||||
assertQuery("intopic:{^.*feature2$}", change3, change2);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user