use of org.eclipse.xtend.core.xtend.RichString in project xtext-xtend by eclipse.
the class InitialIndentationTest method assertInitialIndentation.
public void assertInitialIndentation(String expectedIndentation, String richString, String initial) throws Exception {
RichString parsedString = richString(richString);
InitialTemplateIndentationComputer computer = new InitialTemplateIndentationComputer(initial);
String actualIndentation = computer.doSwitch(parsedString);
assertEquals(richString, expectedIndentation, actualIndentation);
}
use of org.eclipse.xtend.core.xtend.RichString in project xtext-xtend by eclipse.
the class RichStringEvaluationTest method assertOutput.
@Override
public void assertOutput(String expectedOutput, String richString) throws Exception {
RichString parsedString = richString(richString);
StringBuilderBasedAcceptor acceptor = new StringBuilderBasedAcceptor();
DefaultIndentationHandler handler = new DefaultIndentationHandler();
RichStringProcessor processor = new RichStringProcessor();
processor.process(parsedString, acceptor, handler);
String actualOutput = acceptor.toString();
assertEquals(richString, expectedOutput, actualOutput);
}
use of org.eclipse.xtend.core.xtend.RichString in project xtext-xtend by eclipse.
the class RichStringProcessorTest method doTestStackIsConsistentWithErroneousModel.
protected void doTestStackIsConsistentWithErroneousModel(String string) throws Exception {
RichString richString = richStringWithError(string);
doCheckStackIsConsistent(richString);
}
use of org.eclipse.xtend.core.xtend.RichString in project xtext-xtend by eclipse.
the class RichStringProcessorTest method recordRichStringProcessorEvents.
protected String recordRichStringProcessorEvents(String string) throws Exception {
RichString richString = richString(string);
RichStringProcessor processor = new RichStringProcessor();
RecordingRichStringPartAcceptor acceptor = new RecordingRichStringPartAcceptor();
processor.process(richString, acceptor, new DefaultIndentationHandler());
return acceptor.toString();
}
use of org.eclipse.xtend.core.xtend.RichString in project xtext-xtend by eclipse.
the class RichStringValidationTest method testRichStringValidation_05.
@Test
public void testRichStringValidation_05() throws Exception {
String input = "''' \n" + "\t\tindentedLine\n" + "\t\tindentedLine\n" + " last line'''";
RichString richString = richString(input);
validationTestHelper.assertWarning(richString, XtendPackage.Literals.RICH_STRING_LITERAL, IssueCodes.INCONSISTENT_INDENTATION, "inconsistent", "indentation");
}
Aggregations