use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class UtilTest method testCutFirst2.
public void testCutFirst2() {
prepareForFragments();
CHECK.compareAll(new DiffFragment[] { new DiffFragment(null, ")"), new DiffFragment(" {", " {") }, Util.cutFirst(new DiffFragment[] { new DiffFragment(null, ")"), new DiffFragment(") {", ") {") }));
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class UtilTest method testConcatenateWithOneSide.
public void testConcatenateWithOneSide() {
DiffFragment fragment = Util.concatenate(new DiffFragment[] { new DiffFragment("1", "1"), new DiffFragment("a", null) });
assertTrue(fragment.isModified());
assertFalse(fragment.isOneSide());
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class UtilTest method testConcatenateModified.
public void testConcatenateModified() {
DiffFragment fragment = Util.concatenate(new DiffFragment[] { new DiffFragment("a", "b"), DiffFragment.unchanged("1", "1") });
assertTrue(fragment.isModified());
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class CorrectionTest method testTrueLineBlock.
public void testTrueLineBlock() throws FilesTooBigForDiffException {
DiffCorrection.TrueLineBlocks correction = new DiffCorrection.TrueLineBlocks(ComparisonPolicy.DEFAULT);
DiffFragment[] fragments = correction.correctAndNormalize(new DiffFragment[] { DiffFragment.unchanged(" 1\n ab\n x\n", " 2\n ab\n x\n"), new DiffFragment("XXX\n111\n", "YYY\n222\n"), DiffFragment.unchanged(" a\n", " a\n") });
CHECK.compareAll(new DiffFragment[] { new DiffFragment(" 1\n", " 2\n"), new DiffFragment(" ab\n", " ab\n"), new DiffFragment(" x\n", " x\n"), new DiffFragment("XXX\n111\n", "YYY\n222\n"), new DiffFragment(" a\n", " a\n") }, fragments);
}
use of com.intellij.openapi.diff.ex.DiffFragment in project intellij-community by JetBrains.
the class NormalizationTest method testSingleSide.
public void testSingleSide() throws FilesTooBigForDiffException {
DiffCorrection correction = DiffCorrection.Normalize.INSTANCE;
DiffFragment[] corrected = correction.correct(new DiffFragment[] { new DiffFragment(null, "a"), new DiffFragment("b", null), new DiffFragment("c", "d"), new DiffFragment(null, "a"), new DiffFragment("b", null), new DiffFragment("1", null), new DiffFragment("x", "x"), new DiffFragment(null, "a") });
CHECK.compareAll(new DiffFragment[] { new DiffFragment("b", "a"), new DiffFragment("c", "d"), new DiffFragment("b1", "a"), new DiffFragment("x", "x"), new DiffFragment(null, "a") }, corrected);
}
Aggregations