Skip to content

Commit

Permalink
fix test to deal correctly with null values coming back from document…
Browse files Browse the repository at this point in the history
… highlight requests
  • Loading branch information
martinlippert committed Oct 9, 2024
1 parent 16f4d0c commit 39fb0b4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,13 @@ public void assertDocumentHighlights(String afterString, DocumentHighlight... ex
pos += afterString.length();
}
List<? extends DocumentHighlight> actual = harness.getDocumentHighlights(doc.getId(), doc.toPosition(pos));
assertEquals(ImmutableList.copyOf(expected), actual);

if (actual == null) {
assertTrue(expected == null || expected.length == 0);
}
else {
assertEquals(ImmutableList.copyOf(expected), actual);
}
}

/**
Expand Down

0 comments on commit 39fb0b4

Please # to comment.