Search in sources :

Example 21 with ParserRuleParameters

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

the class AbstractParametersParsingTest method testScenario7_keyword.

@Test
public void testScenario7_keyword() {
    try {
        final ParserRuleParameters instance = this.getModel("#7 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 22 with ParserRuleParameters

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

the class AbstractParametersParsingTest method testScenario10_keyword.

@Test
public void testScenario10_keyword() {
    try {
        final ParserRuleParameters instance = this.getModelWithErrors("#10 keyword");
        Assert.assertEquals("keyword", instance.getScenario().getSecond());
        Assert.assertEquals("mismatched input \'<EOF>\' expecting \'keyword\'", 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)

Example 23 with ParserRuleParameters

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

the class AbstractParametersParsingTest method testScenario11_id_keyword.

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

Example 24 with ParserRuleParameters

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

the class AbstractParametersParsingTest method testScenario6_keyword.

@Test
public void testScenario6_keyword() {
    try {
        final ParserRuleParameters instance = this.getModelWithErrors("#6 keyword");
        Assert.assertEquals(null, instance.getScenario());
        Assert.assertEquals("no viable alternative at input \'#6\'", 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)

Example 25 with ParserRuleParameters

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

the class AbstractParametersParsingTest method testScenario10_id_keyword.

@Test
public void testScenario10_id_keyword() {
    try {
        final ParserRuleParameters instance = this.getModel("#10 id keyword");
        Assert.assertEquals("id", instance.getScenario().getSecond());
    } 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