Skip to content

Commit 39fb0b4

Browse files
committed
fix test to deal correctly with null values coming back from document highlight requests
1 parent 16f4d0c commit 39fb0b4

File tree

1 file changed

+7
-1
lines changed
  • headless-services/commons/language-server-test-harness/src/main/java/org/springframework/ide/vscode/languageserver/testharness

1 file changed

+7
-1
lines changed

headless-services/commons/language-server-test-harness/src/main/java/org/springframework/ide/vscode/languageserver/testharness/Editor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,13 @@ public void assertDocumentHighlights(String afterString, DocumentHighlight... ex
248248
pos += afterString.length();
249249
}
250250
List<? extends DocumentHighlight> actual = harness.getDocumentHighlights(doc.getId(), doc.toPosition(pos));
251-
assertEquals(ImmutableList.copyOf(expected), actual);
251+
252+
if (actual == null) {
253+
assertTrue(expected == null || expected.length == 0);
254+
}
255+
else {
256+
assertEquals(ImmutableList.copyOf(expected), actual);
257+
}
252258
}
253259

254260
/**

0 commit comments

Comments
 (0)