fix test to deal correctly with null values coming back from document highlight requests

This commit is contained in:
Martin Lippert
2024-10-09 13:17:14 +02:00
parent 16f4d0c014
commit 39fb0b4ecd

View File

@@ -248,7 +248,13 @@ public class Editor {
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);
}
}
/**