mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: do not forget about start offset
This commit is contained in:
@@ -55,7 +55,7 @@ public class PatienceIntLCS {
|
||||
return;
|
||||
}
|
||||
|
||||
int startOffset = matchForward(0, 0);
|
||||
int startOffset = matchForward(myStart1, myStart2);
|
||||
int start1 = myStart1 + startOffset;
|
||||
int start2 = myStart2 + startOffset;
|
||||
|
||||
|
||||
@@ -70,6 +70,13 @@ public class PatienceIntLCSTest extends TestCase {
|
||||
new int[]{0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1});
|
||||
}
|
||||
|
||||
public void testBug1() throws FilesTooBigForDiffException {
|
||||
BitSet[] change = buildChange(new int[]{2, 3, 4, 6, 7, 8, 9, 11, 12, 4, 6, 11, 15},
|
||||
new int[]{2, 3, 6, 7, 8, 9, 6, 11, 12, 4, 11, 15, 6});
|
||||
checkChange(change, new int[]{0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
|
||||
new int[]{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0});
|
||||
}
|
||||
|
||||
public void testInnerChunks1() throws FilesTooBigForDiffException {
|
||||
BitSet[] change = buildChange(new int[]{0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0}, new int[]{1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1});
|
||||
checkChange(change, new int[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}, new int[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1});
|
||||
|
||||
Reference in New Issue
Block a user