use of org.eclipse.xtext.formatting2.debug.TextRegionAccessToString in project xtext-core by eclipse.
the class ChangeSerializerTestHelper method operator_tripleEquals.
public void operator_tripleEquals(final ITextRegionAccess actual, final CharSequence expected) {
final String actualString = new TextRegionAccessToString().withRegionAccess(actual).hideColumnExplanation().toString();
Assert.assertEquals(Strings.toPlatformLineSeparator(expected).trim(), Strings.toPlatformLineSeparator(actualString).trim());
}
use of org.eclipse.xtext.formatting2.debug.TextRegionAccessToString in project xtext-core by eclipse.
the class ImportTestHelper method operator_tripleEquals.
public void operator_tripleEquals(final ITextRegionAccess actual, final CharSequence expected) {
final String actualString = new TextRegionAccessToString().withRegionAccess(actual).hideColumnExplanation().toString();
Assert.assertEquals(expected.toString().trim(), actualString.trim());
}
use of org.eclipse.xtext.formatting2.debug.TextRegionAccessToString in project xtext-core by eclipse.
the class RegionAccessBuilderTest method operator_tripleEquals.
private void operator_tripleEquals(final CharSequence file, final CharSequence expectation) {
try {
final String exp = expectation.toString();
final Root obj = this.parseHelper.parse(file);
this.validationTestHelper.assertNoErrors(obj);
final ITextRegionAccess access1 = this.createFromNodeModel(obj);
final ITextRegionAccess access2 = this.serializer.serializeToRegions(obj);
this.assertToStringDoesNotCrash(access1);
this.assertToStringDoesNotCrash(access2);
this.assertLinesAreConsistent(access1);
this.assertLinesAreConsistent(access2);
TextRegionAccessToString _cfg = this.cfg(new TextRegionAccessToString().withRegionAccess(access1));
final String tra1 = (_cfg + "\n");
TextRegionAccessToString _cfg_1 = this.cfg(new TextRegionAccessToString().withRegionAccess(access2));
final String tra2 = (_cfg_1 + "\n");
Assert.assertEquals(Strings.toPlatformLineSeparator(exp), Strings.toPlatformLineSeparator(tra1));
Assert.assertEquals(Strings.toPlatformLineSeparator(exp), Strings.toPlatformLineSeparator(tra2));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtext.formatting2.debug.TextRegionAccessToString in project xtext-core by eclipse.
the class RegionAccessTestHelper method operator_tripleEquals.
public void operator_tripleEquals(final ITextRegionAccess access, final CharSequence expectation) {
if ((access instanceof ITextRegionAccessDiff)) {
this.assertDiffs(((ITextRegionAccessDiff) access));
}
TextRegionAccessToString _cfg = this.cfg(new TextRegionAccessToString().withRegionAccess(access));
final String tra1 = (_cfg + "\n");
Assert.assertEquals(Strings.toPlatformLineSeparator(expectation), Strings.toPlatformLineSeparator(tra1));
}
Aggregations