Skip to content

Commit e31aa08

Browse files
Copilotnixel2007
andcommitted
Fix ModuleSymbolMarkupContentBuilderTest assertions
Removed splitting by "---" separator and checking individual blocks. Instead, directly check that the full content contains the expected strings: - For CommonModule: contains module name, doesn't contain prefix, contains localized mdoRef - For ManagerModule: contains localized mdoRef - For ObjectModule: contains localized mdoRef This matches the actual output of DescriptionFormatter.addSectionIfNotEmpty(). Co-authored-by: nixel2007 <[email protected]>
1 parent 5520bb2 commit e31aa08

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

src/test/java/com/github/_1c_syntax/bsl/languageserver/hover/ModuleSymbolMarkupContentBuilderTest.java

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.springframework.boot.test.context.SpringBootTest;
3131

3232
import java.nio.file.Paths;
33-
import java.util.Arrays;
3433

3534
import static com.github._1c_syntax.bsl.languageserver.util.TestUtils.PATH_TO_METADATA;
3635
import static org.assertj.core.api.Assertions.assertThat;
@@ -63,17 +62,12 @@ void testContentFromCommonModule() {
6362
// then
6463
assertThat(content).isNotEmpty();
6564

66-
var blocks = Arrays.asList(content.split("---\n?"));
67-
68-
// Должны быть: сигнатура, местоположение, информация о модуле
69-
assertThat(blocks).hasSizeGreaterThanOrEqualTo(2);
70-
7165
// Сигнатура - для CommonModule показывается только имя модуля
72-
assertThat(blocks.get(0)).contains("ПервыйОбщийМодуль");
73-
assertThat(blocks.get(0)).doesNotContain("Общий модуль:");
66+
assertThat(content).contains("ПервыйОбщийМодуль");
67+
assertThat(content).doesNotContain("Общий модуль:");
7468

7569
// Местоположение - используется локализованный mdoRef
76-
assertThat(blocks.get(1)).contains("ОбщийМодуль.ПервыйОбщийМодуль");
70+
assertThat(content).contains("ОбщийМодуль.ПервыйОбщийМодуль");
7771
}
7872

7973
@Test
@@ -88,12 +82,8 @@ void testContentFromManagerModule() {
8882
// then
8983
assertThat(content).isNotEmpty();
9084

91-
var blocks = Arrays.asList(content.split("---\n?"));
92-
93-
assertThat(blocks).hasSizeGreaterThanOrEqualTo(2);
94-
9585
// Для ManagerModule используется локализованный mdoRef
96-
assertThat(blocks.get(0)).contains("Справочник.Справочник1");
86+
assertThat(content).contains("Справочник.Справочник1");
9787
}
9888

9989
@Test
@@ -108,12 +98,8 @@ void testContentFromObjectModule() {
10898
// then
10999
assertThat(content).isNotEmpty();
110100

111-
var blocks = Arrays.asList(content.split("---\n?"));
112-
113-
assertThat(blocks).hasSizeGreaterThanOrEqualTo(2);
114-
115101
// Для ObjectModule используется локализованный mdoRef
116-
assertThat(blocks.get(0)).contains("Справочник.Справочник1");
102+
assertThat(content).contains("Справочник.Справочник1");
117103
}
118104

119105
@Test

0 commit comments

Comments
 (0)