diff options
author | Shawn Pearce <spearce@spearce.org> | 2017-04-04 22:26:35 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2017-04-04 22:26:38 -0400 |
commit | db2493e7d8198021c789c9f96ca7a8c0c01c8488 (patch) | |
tree | 3d870d0886f1b3abe4a33c2004954b855472efba /org.eclipse.jgit.test/tst/org/eclipse/jgit/merge | |
parent | cab9dee333513ad428d151ac4a6db00173fb6113 (diff) | |
parent | 4a985f5aa858a71561d55c9eb3ce007768c4d0c0 (diff) | |
download | jgit-db2493e7d8198021c789c9f96ca7a8c0c01c8488.tar.gz jgit-db2493e7d8198021c789c9f96ca7a8c0c01c8488.zip |
Merge "Make diff locations more consistent"
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/merge')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java index d4a3d62dad..5af62b6704 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java @@ -132,6 +132,45 @@ public class MergeAlgorithmTest { } /** + * Merge two modifications with a shared delete at the end. The underlying + * diff algorithm has to provide consistent edit results to get the expected + * merge result. + * + * @throws IOException + */ + @Test + public void testTwoModificationsWithSharedDelete() throws IOException { + assertEquals(t("Cb}n}"), + merge("ab}n}n}", "ab}n}", "Cb}n}")); + } + + /** + * Merge modifications with a shared insert in the middle. The + * underlying diff algorithm has to provide consistent edit + * results to get the expected merge result. + * + * @throws IOException + */ + @Test + public void testModificationsWithMiddleInsert() throws IOException { + assertEquals(t("aBcd123123uvwxPq"), + merge("abcd123uvwxpq", "aBcd123123uvwxPq", "abcd123123uvwxpq")); + } + + /** + * Merge modifications with a shared delete in the middle. The + * underlying diff algorithm has to provide consistent edit + * results to get the expected merge result. + * + * @throws IOException + */ + @Test + public void testModificationsWithMiddleDelete() throws IOException { + assertEquals(t("Abz}z123Q"), + merge("abz}z}z123q", "Abz}z123Q", "abz}z123q")); + } + + /** * Test a conflicting region at the very start of the text. * * @throws IOException |