Skip to content

Commit aa3b4d5

Browse files
committed
корректировка теста
1 parent 26aafa5 commit aa3b4d5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SymbolProviderTest.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import org.springframework.boot.test.context.SpringBootTest;
3232
import org.springframework.test.annotation.DirtiesContext;
3333

34+
import java.nio.file.Paths;
35+
3436
import static com.github._1c_syntax.bsl.languageserver.util.TestUtils.PATH_TO_METADATA;
3537
import static org.assertj.core.api.Assertions.assertThat;
3638

@@ -64,31 +66,35 @@ void getSymbols() {
6466
.hasSizeGreaterThan(0)
6567
.anyMatch(symbolInformation ->
6668
symbolInformation.getName().equals("НеУстаревшаяПроцедура")
67-
&& symbolInformation.getLocation().getUri().contains("ПервыйОбщийМодуль")
69+
&& uriContains(symbolInformation, "ПервыйОбщийМодуль")
6870
&& symbolInformation.getKind() == SymbolKind.Method
6971
&& !symbolInformation.getDeprecated()
7072
)
7173
.anyMatch(symbolInformation ->
7274
symbolInformation.getName().equals("НеУстаревшаяПроцедура")
73-
&& symbolInformation.getLocation().getUri().contains("РегистрСведений1")
75+
&& uriContains(symbolInformation, "РегистрСведений1")
7476
&& symbolInformation.getKind() == SymbolKind.Method
7577
&& !symbolInformation.getDeprecated()
7678
)
7779
.anyMatch(symbolInformation ->
7880
symbolInformation.getName().equals("УстаревшаяПроцедура")
79-
&& symbolInformation.getLocation().getUri().contains("ПервыйОбщийМодуль")
81+
&& uriContains(symbolInformation, "ПервыйОбщийМодуль")
8082
&& symbolInformation.getKind() == SymbolKind.Method
8183
&& symbolInformation.getDeprecated()
8284
)
8385
.anyMatch(symbolInformation ->
8486
symbolInformation.getName().equals("ВалютаУчета")
85-
&& symbolInformation.getLocation().getUri().contains("ManagedApplicationModule")
87+
&& uriContains(symbolInformation, "ManagedApplicationModule")
8688
&& symbolInformation.getKind() == SymbolKind.Variable
8789
&& !symbolInformation.getDeprecated()
8890
)
8991
;
9092
}
9193

94+
private boolean uriContains(org.eclipse.lsp4j.SymbolInformation symbolInformation, String name) {
95+
return Paths.get(Absolute.uri(symbolInformation.getLocation().getUri())).toString().contains(name);
96+
}
97+
9298
@Test
9399
void getSymbolsQueryString() {
94100

@@ -134,7 +140,6 @@ void getSymbolsQueryStringErrorRegex() {
134140

135141
// then
136142
assertThat(symbols).isEmpty();
137-
;
138143
}
139144

140145

0 commit comments

Comments
 (0)