use of org.eclipse.xtend.core.xtend.RichString in project xtext-xtend by eclipse.
the class RichStringProcessorTest method richStringWithError.
protected RichString richStringWithError(String string) throws Exception {
XtextResourceSet set = getResourceSet();
String fileName = getFileName(string);
Resource resource = set.createResource(URI.createURI(fileName + ".xtend"));
resource.load(new StringInputStream(getPrefix() + string + "}"), null);
XtendFile file = (XtendFile) resource.getContents().get(0);
XtendClass clazz = (XtendClass) file.getXtendTypes().get(0);
XtendFunction function = (XtendFunction) clazz.getMembers().get(0);
return (RichString) function.getExpression();
}
use of org.eclipse.xtend.core.xtend.RichString in project xtext-xtend by eclipse.
the class RichStringValidationTest method assertValidRichString.
protected void assertValidRichString(String input) throws Exception {
RichString richString = richString(input);
validationTestHelper.assertNoIssues(richString);
}
use of org.eclipse.xtend.core.xtend.RichString in project xtext-xtend by eclipse.
the class RichStringValidationTest method testRichStringValidation_04.
@Test
public void testRichStringValidation_04() throws Exception {
String input = "''' \n" + "\t\tindentedLine\n" + " \tindentedLine\n" + " '''";
RichString richString = richString(input);
validationTestHelper.assertWarning(richString, XtendPackage.Literals.RICH_STRING_LITERAL, IssueCodes.INCONSISTENT_INDENTATION, "inconsistent", "indentation");
}
Aggregations