Search in sources :

Example 6 with TestableTextSegmentSet

use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.

the class RegionSetTest method testMergeConflic1.

@Test
public void testMergeConflic1() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("issues=mergeConflict:[20,0]<>[20,0]");
    _builder.newLine();
    _builder.append("set=[]");
    _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, 0);
        it.add(_textSegment_1);
    };
    this.test(_builder, _function);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextSegment(org.eclipse.xtext.formatting2.regionaccess.internal.TextSegment) ITextSegment(org.eclipse.xtext.formatting2.regionaccess.ITextSegment) TestableTextSegmentSet(org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet) Test(org.junit.Test)

Example 7 with TestableTextSegmentSet

use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.

the class RegionSetTest method testMergeConflic5.

@Test
public void testMergeConflic5() {
    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);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextSegment(org.eclipse.xtext.formatting2.regionaccess.internal.TextSegment) ITextSegment(org.eclipse.xtext.formatting2.regionaccess.ITextSegment) TestableTextSegmentSet(org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet) Test(org.junit.Test)

Example 8 with TestableTextSegmentSet

use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.

the class RegionSetTest method testAddValid.

@Test
public void testAddValid() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("issues=");
    _builder.newLine();
    _builder.append("set=[[10,0], [10,1], [11,1], [12,1], [99,1], [100,0]]");
    _builder.newLine();
    final Procedure1<TestableTextSegmentSet> _function = (TestableTextSegmentSet it) -> {
        TextSegment _textSegment = new TextSegment(null, 10, 0);
        it.add(_textSegment);
        TextSegment _textSegment_1 = new TextSegment(null, 11, 1);
        it.add(_textSegment_1);
        TextSegment _textSegment_2 = new TextSegment(null, 99, 1);
        it.add(_textSegment_2);
        TextSegment _textSegment_3 = new TextSegment(null, 10, 1);
        it.add(_textSegment_3);
        TextSegment _textSegment_4 = new TextSegment(null, 100, 0);
        it.add(_textSegment_4);
        TextSegment _textSegment_5 = new TextSegment(null, 12, 1);
        it.add(_textSegment_5);
    };
    this.test(_builder, _function);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextSegment(org.eclipse.xtext.formatting2.regionaccess.internal.TextSegment) ITextSegment(org.eclipse.xtext.formatting2.regionaccess.ITextSegment) TestableTextSegmentSet(org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet) Test(org.junit.Test)

Example 9 with TestableTextSegmentSet

use of org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet in project xtext-core by eclipse.

the class RegionSetTest method testMergeConflic2.

@Test
public void testMergeConflic2() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("issues=mergeConflict:[21,0]<>[20,2]");
    _builder.newLine();
    _builder.append("set=[[20,2]]");
    _builder.newLine();
    final Procedure1<TestableTextSegmentSet> _function = (TestableTextSegmentSet it) -> {
        TextSegment _textSegment = new TextSegment(null, 20, 2);
        it.add(_textSegment);
        TextSegment _textSegment_1 = new TextSegment(null, 21, 0);
        it.add(_textSegment_1);
    };
    this.test(_builder, _function);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextSegment(org.eclipse.xtext.formatting2.regionaccess.internal.TextSegment) ITextSegment(org.eclipse.xtext.formatting2.regionaccess.ITextSegment) TestableTextSegmentSet(org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet) Test(org.junit.Test)

Aggregations

TestableTextSegmentSet (org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet)9 ITextSegment (org.eclipse.xtext.formatting2.regionaccess.ITextSegment)9 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)8 TextSegment (org.eclipse.xtext.formatting2.regionaccess.internal.TextSegment)8 Test (org.junit.Test)8 ArrayListTextSegmentSet (org.eclipse.xtext.formatting2.internal.ArrayListTextSegmentSet)1