aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2020-06-26 11:23:47 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2020-06-26 11:24:48 +0900
commit14509f4cbbc9d99fd487ee8462dce07eb11909b5 (patch)
tree2fd578fd2d5347657a65cec9bf46ce765f513365 /org.eclipse.jgit.test
parentd1577f79c4933eefc2cb9691993793d914a8745a (diff)
downloadjgit-14509f4cbbc9d99fd487ee8462dce07eb11909b5.tar.gz
jgit-14509f4cbbc9d99fd487ee8462dce07eb11909b5.zip
DiffFormatterTest: Add a test to confirm the default rename detection settings
Add a test that confirms: - No rename detector is initialized by default - Rename detector is initialized after calling setDetectRenames(true) - Rename limit and rename score have the default values 400 and 60, respectively. Note that there are no constants for these values so the test hard codes them. Change-Id: I327e2b348a40ef67d8a184e5ab09f4e9ab573e1c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
index 3d46a47ced..a929def2ff 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
@@ -11,6 +11,8 @@
package org.eclipse.jgit.diff;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
@@ -74,6 +76,17 @@ public class DiffFormatterTest extends RepositoryTestCase {
}
@Test
+ public void testDefaultRenameDetectorSettings() throws Exception {
+ RenameDetector rd = df.getRenameDetector();
+ assertNull(rd);
+ df.setDetectRenames(true);
+ rd = df.getRenameDetector();
+ assertNotNull(rd);
+ assertEquals(400, rd.getRenameLimit());
+ assertEquals(60, rd.getRenameScore());
+ }
+
+ @Test
public void testCreateFileHeader_Add() throws Exception {
ObjectId adId = blob("a\nd\n");
DiffEntry ent = DiffEntry.add("FOO", adId);