use of org.eclipse.xtext.parsetree.reconstr.bug302128.Model in project xtext-core by eclipse.
the class Bug250313Test method testIDConversion_06.
@Test
public void testIDConversion_06() throws Exception {
Model model = (Model) getModel("1+ ^str");
assertEquals("[str]", model.getMultiValue().toString());
assertEquals("org.eclipse.xtext.common.Terminals.ID", lexerRule);
assertTrue(node instanceof ILeafNode);
assertEquals("^str", string);
assertEquals(1, convertCallCount);
}
use of org.eclipse.xtext.parsetree.reconstr.bug302128.Model in project xtext-core by eclipse.
the class Bug250313Test method testNestedDatatypeConversion_10.
@Test
public void testNestedDatatypeConversion_10() throws Exception {
Model model = (Model) getModel("4+ zonk +");
assertEquals("[str]", model.getMultiValue().toString());
assertEquals("org.eclipse.xtext.valueconverter.Bug250313.NestedDatatype", lexerRule);
assertTrue(node instanceof ICompositeNode);
assertEquals(4, Iterables.size(((ICompositeNode) node).getChildren()));
assertEquals("zonk +", string);
assertEquals(1, convertCallCount);
}
use of org.eclipse.xtext.parsetree.reconstr.bug302128.Model in project xtext-core by eclipse.
the class Bug250313Test method testKeywordConversion_01.
@Test
public void testKeywordConversion_01() throws Exception {
Model model = (Model) getModel("1 mykeyword1");
assertEquals("mykeyword1", model.getValue());
// XXX value converter is not called for keywords?
// if this is a bug, all assertions 'assertEquals(1, convertCallCount)' have to be increased
assertEquals(lexerRule, 0, convertCallCount);
}
use of org.eclipse.xtext.parsetree.reconstr.bug302128.Model in project xtext-core by eclipse.
the class Bug305397Test method testBug.
@Test
public void testBug() throws Exception {
with(new Bug305397StandaloneSetup());
Model model = (Model) getModel(" a element \n element X end\n element Y end \nend");
Element outer = model.getElements().get(0);
Element firstInner = outer.getElements().get(0);
ICompositeNode outerNode = NodeModelUtils.getNode(outer);
assertEquals(3, outerNode.getOffset());
ICompositeNode firstInnerNode = NodeModelUtils.getNode(firstInner);
assertEquals(17, firstInnerNode.getOffset());
}
use of org.eclipse.xtext.parsetree.reconstr.bug302128.Model in project xtext-core by eclipse.
the class Bug299395Test method testSerialization_07.
@Test
public void testSerialization_07() {
Model model = Bug299395Factory.eINSTANCE.createModel();
SubModel subModel = Bug299395Factory.eINSTANCE.createSubModel();
model.setSubModel(subModel);
subModel.getStrings().add("s1");
String serialized = getSerializer().serialize(model);
assertEquals("subModel 1 2 \"s1\"", serialized);
}
Aggregations