use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.
the class RegionSetTest method testMergeConflic4.
@Test
public void testMergeConflic4() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("issues=mergeConflict:[20,2]<>[21,5]");
_builder.newLine();
_builder.append("set=[[21,5]]");
_builder.newLine();
final Procedure1<TestableTextSegmentSet> _function = (TestableTextSegmentSet it) -> {
TextSegment _textSegment = new TextSegment(null, 21, 5);
it.add(_textSegment);
TextSegment _textSegment_1 = new TextSegment(null, 20, 2);
it.add(_textSegment_1);
};
this.test(_builder, _function);
}
use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.
the class RegionSetTest method testNoMergeConflic1.
@Test
public void testNoMergeConflic1() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("issues=");
_builder.newLine();
_builder.append("set=[[20,0], [20,1]]");
_builder.newLine();
final Procedure1<TestableTextSegmentSet> _function = (TestableTextSegmentSet it) -> {
TextSegment _textSegment = new TextSegment(null, 20, 0);
it.add(_textSegment);
TextSegment _textSegment_1 = new TextSegment(null, 20, 1);
it.add(_textSegment_1);
};
this.test(_builder, _function);
}
use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.
the class RegionSetTest method test.
private void test(final CharSequence expectation, final Procedure1<? super TestableTextSegmentSet> test) {
Function<ITextSegment, ITextSegment> _identity = Functions.<ITextSegment>identity();
Function<Object, String> _stringFunction = Functions.toStringFunction();
ArrayListTextSegmentSet<ITextSegment> _arrayListTextSegmentSet = new ArrayListTextSegmentSet<ITextSegment>(_identity, _stringFunction, true);
final TestableTextSegmentSet set = new TestableTextSegmentSet(_arrayListTextSegmentSet);
try {
test.apply(set);
} catch (final Throwable _t) {
if (_t instanceof Throwable) {
final Throwable t = (Throwable) _t;
t.printStackTrace();
Assert.fail();
} else {
throw Exceptions.sneakyThrow(_t);
}
}
Assert.assertEquals(expectation.toString(), set.toString());
}
use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.
the class RegionSetTest method testNoMergeConflic2.
@Test
public void testNoMergeConflic2() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("issues=");
_builder.newLine();
_builder.append("set=[[20,0], [20,1]]");
_builder.newLine();
final Procedure1<TestableTextSegmentSet> _function = (TestableTextSegmentSet it) -> {
TextSegment _textSegment = new TextSegment(null, 20, 1);
it.add(_textSegment);
TextSegment _textSegment_1 = new TextSegment(null, 20, 0);
it.add(_textSegment_1);
};
this.test(_builder, _function);
}
use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.
the class RegionSetTest method testMergeConflic3.
@Test
public void testMergeConflic3() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("issues=mergeConflict:[20,2]<>[21,0]");
_builder.newLine();
_builder.append("set=[[20,2]]");
_builder.newLine();
final Procedure1<TestableTextSegmentSet> _function = (TestableTextSegmentSet it) -> {
TextSegment _textSegment = new TextSegment(null, 21, 0);
it.add(_textSegment);
TextSegment _textSegment_1 = new TextSegment(null, 20, 2);
it.add(_textSegment_1);
};
this.test(_builder, _function);
}
Aggregations