use of org.eclipse.xtext.grammarinheritance.inheritanceTest.Model in project xtext-core by eclipse.
the class ParserTest method test_03.
@Test
public void test_03() throws Exception {
Model model = (Model) getModel("model id { element 'string' }");
assertEquals("id", model.getName());
Element element = model.getElements().get(0);
assertEquals("string", element.getName());
List<INode> nodesForFeature = NodeModelUtils.findNodesForFeature(element, InheritanceTestPackage.Literals.ELEMENT__NAME);
assertTrue(nodesForFeature.size() == 1);
assertEquals("'string'", nodesForFeature.get(0).getText());
}
use of org.eclipse.xtext.grammarinheritance.inheritanceTest.Model in project xtext-core by eclipse.
the class ParserTest method test_04.
@Test
public void test_04() throws Exception {
Model model = (Model) getModel("model id { element 'with spaces' }");
assertEquals("id", model.getName());
Element element = model.getElements().get(0);
assertEquals("with spaces", element.getName());
List<INode> nodesForFeature = NodeModelUtils.findNodesForFeature(element, InheritanceTestPackage.Literals.ELEMENT__NAME);
assertTrue(nodesForFeature.size() == 1);
assertEquals("'with spaces'", nodesForFeature.get(0).getText());
}
Aggregations