diff --git a/tests/com.e1c.v8codestyle.bsl.itests/resources/doc-comment-method-ref-link.bsl b/tests/com.e1c.v8codestyle.bsl.itests/resources/doc-comment-method-ref-link.bsl new file mode 100644 index 00000000..21bab389 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/resources/doc-comment-method-ref-link.bsl @@ -0,0 +1,25 @@ +// comment see CommonModule1.NonExists1 +// also see CommonModule1.NonExists8 another +// +// Parameters: +// param - String - see CommonModule1.NonExists2 another +// +// Returns: +// - string - some string see CommonModule1.NonExists2 another +// +// Example: +// see CommonModule1.NonExists9 +// +Function Proc1(param) + + var Value; // number - it is an inline doc comment see CommonModule1.NonExists4 + + // free comment in procedure body see CommonModule1.NonExists5 + // + // see CommonModule1.NonExists6 + + // doc comment see CommonModule1.NonExists7 + + return Value; + +EndFunction \ No newline at end of file diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/RefLinkPartCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/RefLinkPartCheckTest.java index 26753ea9..39d30fe5 100644 --- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/RefLinkPartCheckTest.java +++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/RefLinkPartCheckTest.java @@ -81,4 +81,25 @@ public void testInvalidLinks() throws Exception assertEquals(Set.of("5", "7"), lines); } + + /** + * Сhecks for invalid links in the method body and documenting comment + * + * @throws Exception the exception + */ + @Test + public void testInvalidLinksInMethodComments() throws Exception + { + updateModule(FOLDER_RESOURCE + "doc-comment-method-ref-link.bsl"); + + List markers = getModuleMarkers(); + assertEquals(9, markers.size()); + + Set lines = markers.stream() + .map(marker -> marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY)) + .collect(Collectors.toSet()); + + Set expected = Set.of("1", "2", "5", "8", "11", "15", "17", "19", "21"); + assertEquals(expected, lines); + } }