use of org.eclipse.che.ide.api.editor.changeintercept.TextChange in project che by eclipse.
the class CloseCStyleCommentChangeInterceptorTest method testNotFirstLineNoLeadingSpaces.
/**
* The input is a normal /* */ comment without leading spaces.
*/
@Ignore
@Test
public void testNotFirstLineNoLeadingSpaces() {
doReturn("").when(document).getLineContent(0);
doReturn("/*").when(document).getLineContent(1);
doReturn(" *").when(document).getLineContent(2);
final TextChange input = new TextChange.Builder().from(new TextPosition(1, 2)).to(new TextPosition(2, 2)).insert("\n *").build();
final TextChange output = interceptor.processChange(input, document);
assertNotNull(output);
final TextChange expected = new TextChange.Builder().from(new TextPosition(1, 2)).to(new TextPosition(3, 3)).insert("\n * \n */").build();
Assert.assertEquals(expected, output);
}
use of org.eclipse.che.ide.api.editor.changeintercept.TextChange in project che by eclipse.
the class CloseCStyleCommentChangeInterceptorTest method testFirstLineNoLeadingSpaces.
@Ignore
@Test
public void testFirstLineNoLeadingSpaces() {
doReturn("/*").when(document).getLineContent(0);
doReturn(" *").when(document).getLineContent(1);
final TextChange input = new TextChange.Builder().from(new TextPosition(0, 2)).to(new TextPosition(1, 2)).insert("\n *").build();
final TextChange output = interceptor.processChange(input, document);
assertNotNull(output);
final TextChange expected = new TextChange.Builder().from(new TextPosition(0, 2)).to(new TextPosition(2, 3)).insert("\n * \n */").build();
Assert.assertEquals(expected, output);
}
use of org.eclipse.che.ide.api.editor.changeintercept.TextChange in project che by eclipse.
the class CloseCStyleCommentChangeInterceptorTest method testAddWithComment.
@Ignore
@Test
public void testAddWithComment() {
doReturn("/*").when(document).getLineContent(0);
doReturn("/*").when(document).getLineContent(1);
doReturn(" *").when(document).getLineContent(2);
final TextChange input = new TextChange.Builder().from(new TextPosition(1, 2)).to(new TextPosition(2, 2)).insert("\n *").build();
final TextChange output = interceptor.processChange(input, document);
assertNull(output);
}
Aggregations