use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class NormalizationTest method testUnitesEquals.
public void testUnitesEquals() throws FilesTooBigForDiffException {
DiffCorrection correction = DiffCorrection.Normalize.INSTANCE;
DiffFragment[] fragments = correction.correct(new DiffFragment[] { new DiffFragment(null, "a"), new DiffFragment("x", "x"), new DiffFragment("y", "y"), new DiffFragment("z", null), new DiffFragment(null, "z") });
CHECK.compareAll(new DiffFragment[] { new DiffFragment(null, "a"), new DiffFragment("xyz", "xyz") }, fragments);
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class UniteSameTypeTest method testUniteEqualsUnitesFormattingOnly.
public void testUniteEqualsUnitesFormattingOnly() throws FilesTooBigForDiffException {
DiffFragment changed = new DiffFragment("abc", "123");
DiffFragment equal = new DiffFragment("qqq", "qqq");
DiffFragment[] fragments = DiffCorrection.UnitEquals.INSTANCE.correct(new DiffFragment[] { changed, new DiffFragment(" xxx", "xxx"), new DiffFragment("yyy", " yyy"), equal });
CHECK.compareAll(new DiffFragment[] { changed, new DiffFragment(" xxxyyy", "xxx yyy"), equal }, fragments);
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class ByWordTest method testIdea58505Trim.
public void testIdea58505Trim() throws FilesTooBigForDiffException {
DiffPolicy byWord = new ByWord(ComparisonPolicy.TRIM_SPACE);
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 ByWordTest method test2.
public void test2() throws FilesTooBigForDiffException {
DiffPolicy byWord = new ByWord(ComparisonPolicy.DEFAULT);
DiffFragment[] fragments = byWord.buildFragments(" a[xy]+1", ",a[]+1");
CHECK.compareAll(new DiffFragment[] { new DiffFragment(" ", null), new DiffFragment(null, ","), new DiffFragment("a[", "a["), new DiffFragment("xy", null), new DiffFragment("]+1", "]+1") }, fragments);
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class ByWordTest method test3.
public void test3() throws FilesTooBigForDiffException {
DiffPolicy byWord = new ByWord(ComparisonPolicy.DEFAULT);
DiffFragment[] fragments = byWord.buildFragments("0987\n a.g();\n", "yyyy\n");
CHECK.compareAll(new DiffFragment[] { new DiffFragment("0987\n a.g();\n", "yyyy\n") }, fragments);
}
Aggregations