use of org.eclipse.xtext.xbase.XStringLiteral in project xtext-xtend by eclipse.
the class ParserTest method testRichStringFOR_02.
@Test
public void testRichStringFOR_02() throws Exception {
XtendFunction function = function("def withForLoop() '''�FOR i: 1..10 BEFORE 'a' SEPARATOR '\t' AFTER i��ENDFOR�'''");
final RichString richString = (RichString) function.getExpression();
final RichStringForLoop rsFor = (RichStringForLoop) richString.getExpressions().get(1);
assertTrue(rsFor.getForExpression() instanceof XBinaryOperation);
assertEquals("i", rsFor.getDeclaredParam().getName());
assertTrue(rsFor.getSeparator() instanceof XStringLiteral);
assertTrue(rsFor.getBefore() instanceof XStringLiteral);
assertTrue(rsFor.getAfter() instanceof XFeatureCall);
assertTrue(((XAbstractFeatureCall) rsFor.getAfter()).getFeature().eIsProxy());
}
use of org.eclipse.xtext.xbase.XStringLiteral in project xtext-xtend by eclipse.
the class ParserTest method testXtendField_04.
@Test
public void testXtendField_04() throws Exception {
XtendClass clazz = clazz("class Foo { " + " @com.google.inject.Inject val foo = 'foo'" + " @com.google.inject.Inject var java.util.List myList" + "}");
assertEquals(2, clazz.getMembers().size());
XtendField field = (XtendField) clazz.getMembers().get(0);
assertNull(field.getType());
assertEquals("foo", field.getName());
assertTrue(field.getInitialValue() instanceof XStringLiteral);
field = (XtendField) clazz.getMembers().get(1);
assertEquals("java.util.List", field.getType().getType().getIdentifier());
assertEquals("myList", field.getName());
assertEquals("java.util.List", field.getType().getIdentifier());
}
Aggregations