Skip to content

Commit

Permalink
atlas: add test case for couldMatch with empty index (#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
brharrington committed Jul 10, 2024
1 parent 3bee626 commit 374dadb
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,19 @@ public void findHotSpots() {
});
}

@Test
public void couldMatchEmpty() {
Registry registry = new NoopRegistry();
QueryIndex<Integer> idx = QueryIndex.newInstance(registry);

Assertions.assertFalse(idx.couldMatch(Query.toMap(id("foo"))::get));
Assertions.assertFalse(idx.couldMatch(Query.toMap(id("foo", "id", "bar"))::get));
Assertions.assertFalse(idx.couldMatch(Query.toMap(id("foo", "app", "baz-main"))::get));
Assertions.assertFalse(idx.couldMatch(Query.toMap(id("foo", "id", "baz"))::get));
Assertions.assertFalse(idx.couldMatch(Query.toMap(id("foo2", "id", "bar"))::get));
Assertions.assertFalse(idx.couldMatch(Query.toMap(id("foo", "app", "bar-main"))::get));
}

@Test
public void couldMatchPartial() {
Registry registry = new NoopRegistry();
Expand Down

0 comments on commit 374dadb

Please sign in to comment.