Search in sources :

Example 1 with ArrayListTextSegmentSet

use of org.eclipse.xtext.formatting2.internal.ArrayListTextSegmentSet 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());
}
Also used : ArrayListTextSegmentSet(org.eclipse.xtext.formatting2.internal.ArrayListTextSegmentSet) ITextSegment(org.eclipse.xtext.formatting2.regionaccess.ITextSegment) TestableTextSegmentSet(org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet)

Aggregations

ArrayListTextSegmentSet (org.eclipse.xtext.formatting2.internal.ArrayListTextSegmentSet)1 TestableTextSegmentSet (org.eclipse.xtext.formatting2.internal.TestableTextSegmentSet)1 ITextSegment (org.eclipse.xtext.formatting2.regionaccess.ITextSegment)1