Skip to content
Merged
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
Expand Up @@ -12,8 +12,8 @@ import org.junit.jupiter.api.^extension.ExtendWith
import org.eclipse.xtext.testing.extensions.InjectionExtension
import org.junit.jupiter.api.Test
import static org.junit.jupiter.api.Assertions.assertNotNull
import static org.junit.jupiter.api.Assertions.assertTrue

import static org.junit.jupiter.api.Assertions.assertFalse
import org.eclipse.xtext.resource.XtextResource

@ExtendWith(InjectionExtension)
@InjectWith(FormatInjectorProvider)
Expand All @@ -24,10 +24,17 @@ class FormatParsingTest {
@Test
def void loadModel() {
val result = parseHelper.parse('''
Hello Xtext!
''')
formatter for MyDsl

const String SOME_STRING = "";
const int SOME_INT = 2;

Person {
} '''
)
assertNotNull(result)
val errors = result.eResource.errors
assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''')
assertFalse(
((result.eResource) as XtextResource).getParseResult.
hasSyntaxErrors, '''Unexpected errors: «result.eResource.errors.join(", ")»''')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;

import com.avaloq.tools.ddk.xtext.format.FormatParsingTest;
import com.avaloq.tools.ddk.xtext.format.builder.FormatBuilderParticipantTest;
import com.avaloq.tools.ddk.xtext.format.formatting.FormatFormattingTest;
import com.avaloq.tools.ddk.xtext.format.scoping.FormatScopingTest;
Expand All @@ -23,7 +24,7 @@
* Empty class serving only as holder for JUnit5 annotations.
*/
@Suite
@SelectClasses({FormatFormattingTest.class, FormatValidationTest.class, FormatScopingTest.class, FormatBuilderParticipantTest.class})
@SelectClasses({FormatParsingTest.class, FormatFormattingTest.class, FormatValidationTest.class, FormatScopingTest.class, FormatBuilderParticipantTest.class})
public class FormatTestSuite {

}