Skip to content

Commit 0b23e11

Browse files
Copilotnixel2007
andcommitted
Add range validation test for document links
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
1 parent a70af52 commit 0b23e11

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/java/com/github/_1c_syntax/bsl/languageserver/documentlink/DescriptionDocumentLinkSupplierTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ void testGetDocumentLinks() {
5959
.contains("ftp://files.example.com/docs")
6060
.contains("https://main.example.com/docs")
6161
.contains("http://additional.example.org/info");
62+
63+
// Verify the ranges are correct
64+
var firstLink = documentLinks.stream()
65+
.filter(link -> link.getTarget().equals("https://example.com/info"))
66+
.findFirst()
67+
.orElseThrow();
68+
69+
assertThat(firstLink.getRange().getStart().getLine()).isEqualTo(1);
70+
assertThat(firstLink.getRange().getStart().getCharacter()).isGreaterThanOrEqualTo(0);
71+
assertThat(firstLink.getRange().getEnd().getLine()).isEqualTo(1);
6272
}
6373

6474
@Test

0 commit comments

Comments
 (0)