summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2024-04-09 18:01:37 +0000
committerGerrit Code Review <support@gerrithub.io>2024-04-09 18:01:37 +0000
commit8404bf19a4a6e343ef2a879bf8a9fdd7049312fa (patch)
treed45961f82ee0f84e73b048060a436fa4e8437da3 /org.eclipse.jgit.test
parent5c623b1e6c69f2f67076d668157f9ad6be54422d (diff)
parente4b4f063b335fb6042efbeabff92088d7d1e3f20 (diff)
downloadjgit-8404bf19a4a6e343ef2a879bf8a9fdd7049312fa.tar.gz
jgit-8404bf19a4a6e343ef2a879bf8a9fdd7049312fa.zip
Merge "MergeAlgorithm: Fix diff3 conflict hunk computation"
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java13
1 files changed, 13 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 680a2d5d72..7a8a93e977 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
@@ -162,6 +162,19 @@ public class MergeAlgorithmTest {
merge("abz}z}z123q", "Abz}z123Q", "abz}z123q", true));
}
+ @Test
+ public void testInsertionAfterDeletion() throws IOException {
+ assertEquals(t("a<=bc>d"), merge("abd", "ad", "abcd", false));
+ assertEquals(t("a<|b=bc>d"),
+ merge("abd", "ad", "abcd", true));
+ }
+
+ @Test
+ public void testInsertionBeforeDeletion() throws IOException {
+ assertEquals(t("a<=cb>d"), merge("abd", "ad", "acbd", false));
+ assertEquals(t("a<|b=cb>d"), merge("abd", "ad", "acbd", true));
+ }
+
/**
* Test a conflicting region at the very start of the text.
*