Skip to content

G5V8DT-24769 Добавить тест для проверки валидатора #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<Marker> markers = getModuleMarkers();
assertEquals(9, markers.size());

Set<String> lines = markers.stream()
.map(marker -> marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY))
.collect(Collectors.toSet());

Set<String> expected = Set.of("1", "2", "5", "8", "11", "15", "17", "19", "21");
assertEquals(expected, lines);
}
}
Loading