use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class ByWordTest method testIdea56428.
public void testIdea56428() throws FilesTooBigForDiffException {
DiffPolicy byWord = new ByWord(ComparisonPolicy.DEFAULT);
DiffFragment[] fragments = byWord.buildFragments("messageInsertStatement = connection.prepareStatement(\"INSERT INTO AUDIT (AUDIT_TYPE_ID, STATUS, SERVER_ID, INSTANCE_ID, REQUEST_ID) VALUES (?, ?, ?, ?, ?)\");\n", "messageInsertStatement = connection.prepareStatement(\"INSERT INTO AUDIT (AUDIT_TYPE_ID, CREATION_TIMESTAMP, STATUS, SERVER_ID, INSTANCE_ID, REQUEST_ID) VALUES (?, ?, ?, ?, ?, ?)\");\n");
CHECK.compareAll(new DiffFragment[] { new DiffFragment("messageInsertStatement = connection.prepareStatement(\"INSERT INTO AUDIT (AUDIT_TYPE_ID, ", "messageInsertStatement = connection.prepareStatement(\"INSERT INTO AUDIT (AUDIT_TYPE_ID, "), new DiffFragment(null, "CREATION_TIMESTAMP"), new DiffFragment(null, ","), new DiffFragment(null, " "), new DiffFragment("STATUS, SERVER_ID, INSTANCE_ID, REQUEST_ID) VALUES (?, ?, ?, ?, ?", "STATUS, SERVER_ID, INSTANCE_ID, REQUEST_ID) VALUES (?, ?, ?, ?, ?"), new DiffFragment(null, ", ?"), new DiffFragment(")\");\n", ")\");\n") }, fragments);
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class ByWordTest method testIgnoreSpaces.
public void testIgnoreSpaces() throws FilesTooBigForDiffException {
ByWord byWord = new ByWord(ComparisonPolicy.IGNORE_SPACE);
DiffFragment[] fragments = byWord.buildFragments(" o.f(a)", "o. f( b)");
CHECK.compareAll(new DiffFragment[] { DiffFragment.unchanged(" o.f(", "o. f( "), new DiffFragment("a", "b"), DiffFragment.unchanged(")", ")") }, UniteSameType.INSTANCE.correct(fragments));
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class ByWordTest method testIdea58505.
public void testIdea58505() throws FilesTooBigForDiffException {
DiffPolicy byWord = new ByWord(ComparisonPolicy.DEFAULT);
DiffFragment[] fragments = byWord.buildFragments(" if (eventMerger!=null && !dataSelection.getValueIsAdjusting()) {", " if (eventMerger!=null && (dataSelection==null || !dataSelection.getValueIsAdjusting())) {");
CHECK.compareAll(new DiffFragment[] { new DiffFragment(" if (eventMerger!=null && ", " if (eventMerger!=null && "), new DiffFragment("!", "("), new DiffFragment("dataSelection", "dataSelection"), new DiffFragment(null, "=="), new DiffFragment(null, "null || !dataSelection"), new DiffFragment(".getValueIsAdjusting())", ".getValueIsAdjusting())"), new DiffFragment(null, ")"), new DiffFragment(" {", " {") }, fragments);
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class CorrectionTest method testConnectSingleSideToChange.
public void testConnectSingleSideToChange() throws FilesTooBigForDiffException {
DiffFragment first = DiffFragment.unchanged("a", "A");
DiffFragment oneSide = new DiffFragment(null, "b");
DiffFragment equal = new DiffFragment("c", "c");
DiffFragment last = DiffFragment.unchanged("g", "G");
DiffFragment[] fragments = DiffCorrection.ConnectSingleSideToChange.INSTANCE.correct(new DiffFragment[] { first, oneSide, equal, new DiffFragment(null, "d"), new DiffFragment("e", "E"), new DiffFragment("f", null), last });
CHECK.compareAll(new DiffFragment[] { first, oneSide, equal, new DiffFragment("ef", "dE"), last }, fragments);
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class CorrectionTest method testTrueLineBlocksWithSameLines.
public void testTrueLineBlocksWithSameLines() throws FilesTooBigForDiffException {
DiffCorrection.TrueLineBlocks correction = new DiffCorrection.TrueLineBlocks(ComparisonPolicy.DEFAULT);
DiffFragment[] fragments = correction.correctAndNormalize(new DiffFragment[] { DiffFragment.unchanged(" X\n X\n X", " X\n X\n X") });
CHECK.compareAll(new DiffFragment[] { new DiffFragment(" X\n X\n", " X\n X\n"), new DiffFragment(" X", " X") }, fragments);
}
Aggregations