summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-09-23 14:45:07 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-09-23 14:45:33 -0700
commit4447d76a419926aa9f0640b7a045d8149350c506 (patch)
treeb6d69a4838f8417afd43bf0b3060bce4b3a67c37 /org.eclipse.jgit.test
parentb60eefb247191b37dea3d51e367ed89a2df575a5 (diff)
downloadjgit-4447d76a419926aa9f0640b7a045d8149350c506.tar.gz
jgit-4447d76a419926aa9f0640b7a045d8149350c506.zip
Fix PatienceDiffTest
Because PatienceDiff works by looking for common unique lines within the region, the DiffTestDataGenerator needs to be modified to produce a unique character for each region. If we don't give PatienceDiff a few unique points, it will just offer back a single REPLACE edit that covers the entire files, and this doesn't tell us very much. Change-Id: I5129faea1e763c74739118ca20d86bd62e0deaef Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffTestDataGenerator.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffTestDataGenerator.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffTestDataGenerator.java
index c403112149..91d757bcce 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffTestDataGenerator.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffTestDataGenerator.java
@@ -78,8 +78,11 @@ public class DiffTestDataGenerator {
StringBuilder text = new StringBuilder(len);
int skipStart = skipPeriod - skipLength;
int skippedChars = 0;
+ int block = 0;
for (int i = 0; i - skippedChars < len; ++i) {
- if (skipPeriod == 0 || i % skipPeriod < skipStart) {
+ if ((i % skipPeriod) == 1)
+ text.append((char) (256 + block++));
+ else if (skipPeriod == 0 || i % skipPeriod < skipStart) {
text.append((char) (32 + i % 95));
} else {
skippedChars++;