Search in sources :

Example 26 with ParserRuleParameters

use of org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters in project xtext-core by eclipse.

the class AbstractParametersParsingTest method testScenario5_id.

@Test
public void testScenario5_id() {
    try {
        final ParserRuleParameters instance = this.getModel("#5 id");
        Assert.assertEquals("id", instance.getScenario().getFirst());
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : ParserRuleParameters(org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters) Test(org.junit.Test)

Example 27 with ParserRuleParameters

use of org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters in project xtext-core by eclipse.

the class AbstractParametersParsingTest method testScenario5_keyword.

@Test
public void testScenario5_keyword() {
    try {
        final ParserRuleParameters instance = this.getModel("#5 keyword");
        Assert.assertEquals("keyword", instance.getScenario().getFirst());
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : ParserRuleParameters(org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters) Test(org.junit.Test)

Example 28 with ParserRuleParameters

use of org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters in project xtext-core by eclipse.

the class AbstractParametersParsingTest method testScenario4_keyword.

@Test
public void testScenario4_keyword() {
    try {
        final ParserRuleParameters instance = this.getModelWithErrors("#4 keyword");
        Assert.assertEquals(null, instance.getScenario().getFirst());
        Assert.assertEquals(1, instance.eResource().getErrors().size());
        Assert.assertEquals("mismatched input \'keyword\' expecting RULE_ID", IterableExtensions.<Resource.Diagnostic>head(instance.eResource().getErrors()).getMessage());
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : ParserRuleParameters(org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters) Test(org.junit.Test)

Aggregations

ParserRuleParameters (org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters)28 Test (org.junit.Test)24 EPackage (org.eclipse.emf.ecore.EPackage)4 Action (org.eclipse.xtext.Action)4 Parameter (org.eclipse.xtext.Parameter)4 ParserRule (org.eclipse.xtext.ParserRule)4 Scenario (org.eclipse.xtext.parser.parameters.parametersTestLanguage.Scenario)4