use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.
the class AbstractFragmentsTest method testActionInFragment_01.
@Test
@Ignore("Actions are currently not supported in fragments")
public void testActionInFragment_01() {
final ParserRuleFragments fragments = this.parseAndValidate("#5 prev current");
Assert.assertNotNull(fragments);
Assert.assertEquals("current", fragments.getElement().getName());
PRFNamed _element = fragments.getElement();
Assert.assertEquals("prev", ((PRFNamedWithAction) _element).getPrev().getName());
}
use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.
the class AbstractFragmentsTest method testDatatypeRule_03.
@Test
public void testDatatypeRule_03() {
final ParserRuleFragments fragments = this.parseAndValidate("#8 a.b.c.d - a.b.c.d");
Assert.assertNotNull(fragments);
PRFNamed element = fragments.getElement();
Assert.assertEquals(element, element.getRef());
}
use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.
the class AbstractFragmentsTest method testFragmentRecursive_02.
@Test
public void testFragmentRecursive_02() {
final ParserRuleFragments fragments = this.parseAndValidate("#10 myName ((myPrev))");
Assert.assertNotNull(fragments);
Assert.assertEquals("myName", fragments.getElement().getName());
PRFNamed _element = fragments.getElement();
final PRFNamed prev = ((PRFNamedWithAction) _element).getPrev();
Assert.assertEquals("myPrev", prev.getName());
final ICompositeNode node = NodeModelUtils.findActualNodeFor(prev);
Assert.assertEquals(" ((myPrev))", node.getText());
final EObject lookup = NodeModelUtils.findActualSemanticObjectFor(node);
Assert.assertSame(prev, lookup);
}
use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.
the class AbstractFragmentsTest method testAction.
@Test
public void testAction() {
final ParserRuleFragments fragments = this.parseAndValidate("#4 prev current");
Assert.assertNotNull(fragments);
Assert.assertEquals("current", fragments.getElement().getName());
PRFNamed _element = fragments.getElement();
Assert.assertEquals("prev", ((PRFNamedWithAction) _element).getPrev().getName());
}
use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.
the class AbstractFragmentsTest method testActionInFragment_02.
@Test
@Ignore("Actions are currently not supported in fragments")
public void testActionInFragment_02() {
final ParserRuleFragments fragments = this.parseAndValidate("#6 prev current");
Assert.assertNotNull(fragments);
Assert.assertEquals("current", fragments.getElement().getName());
PRFNamed _element = fragments.getElement();
Assert.assertEquals("prev", ((PRFNamedWithAction) _element).getPrev().getName());
}
Aggregations