use of com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo in project gerrit by GerritCodeReview.
the class LineMapperTest method replaceWithInsertInB.
@Test
public void replaceWithInsertInB() {
// 0 c c
// 1 a b
// 2 a b
// 3 - b
// 4 - b
// 5 c c
LineMapper mapper = new LineMapper();
mapper.appendCommon(1);
mapper.appendReplace(2, 4);
mapper.appendCommon(1);
assertEquals(4, mapper.getLineA());
assertEquals(6, mapper.getLineB());
assertEquals(new LineOnOtherInfo(1, true), mapper.lineOnOther(DisplaySide.B, 1));
assertEquals(new LineOnOtherInfo(3, true), mapper.lineOnOther(DisplaySide.B, 5));
assertEquals(new LineOnOtherInfo(2, true), mapper.lineOnOther(DisplaySide.B, 2));
assertEquals(new LineOnOtherInfo(2, false), mapper.lineOnOther(DisplaySide.B, 3));
}
use of com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo in project gerrit by GerritCodeReview.
the class LineMapperTest method findInDeleteGap.
@Test
public void findInDeleteGap() {
LineMapper mapper = new LineMapper();
mapper.appendDelete(10);
assertEquals(new LineOnOtherInfo(-1, false), mapper.lineOnOther(DisplaySide.A, 9));
}
use of com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo in project gerrit by GerritCodeReview.
the class LineMapperTest method findAfterCommon.
@Test
public void findAfterCommon() {
LineMapper mapper = new LineMapper();
mapper.appendCommon(10);
assertEquals(new LineOnOtherInfo(10, true), mapper.lineOnOther(DisplaySide.A, 10));
assertEquals(new LineOnOtherInfo(10, true), mapper.lineOnOther(DisplaySide.B, 10));
}
use of com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo in project gerrit by GerritCodeReview.
the class LineMapperTest method findAfterDeleteGap.
@Test
public void findAfterDeleteGap() {
LineMapper mapper = new LineMapper();
mapper.appendDelete(10);
assertEquals(new LineOnOtherInfo(0, true), mapper.lineOnOther(DisplaySide.A, 10));
assertEquals(new LineOnOtherInfo(10, true), mapper.lineOnOther(DisplaySide.B, 0));
}
Aggregations