implements PLN-0034 lsp inline hint transport contract
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
package p.studio.lsp.dtos;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
final class LspInlineHintDTOTest {
|
||||
@Test
|
||||
void trimsLabelAndCategory() {
|
||||
final var hint = new LspInlineHintDTO(new LspRangeDTO(3, 3), " int ", " type ");
|
||||
|
||||
assertEquals("int", hint.label());
|
||||
assertEquals("type", hint.category());
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsBlankLabels() {
|
||||
assertThrows(IllegalArgumentException.class, () ->
|
||||
new LspInlineHintDTO(new LspRangeDTO(1, 1), " ", "type"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user