[JGIT PATCH 7/6] BROKEN: Add a zero line context test for diff.DiffFormatter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
---

 This test currently fails because it shows the difference between
 the way CGit and JGit number a zero context line patch.

 Either we hack JGit to match CGit here, or we modify the test
 vector, or CGit agrees there's a bug and fixes their code, and we
 modify the test vector.

 .../org/spearce/jgit/diff/testContext0.out         |   18 ++++++++++++++++++
 .../spearce/jgit/diff/DiffFormatterReflowTest.java |    6 ++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/diff/testContext0.out

diff --git a/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/diff/testContext0.out b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/diff/testContext0.out
new file mode 100644
index 0000000..d36e3fa
--- /dev/null
+++ b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/diff/testContext0.out
@@ -0,0 +1,18 @@
+diff --git a/X b/X
+index a3648a1..2d44096 100644
+--- a/X
++++ b/X
+@@ -2,0 +3 @@
++c
+@@ -17,2 +17,0 @@
+-r
+-s
+@@ -23,2 +22,6 @@
+-x
+-y
++0
++1
++2
++3
++4
++5
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/diff/DiffFormatterReflowTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/diff/DiffFormatterReflowTest.java
index f47282c..5d2ee40 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/diff/DiffFormatterReflowTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/diff/DiffFormatterReflowTest.java
@@ -74,6 +74,12 @@ public void testNegativeContextFails() throws IOException {
 		}
 	}
 
+	public void testContext0() throws IOException {
+		init("X");
+		fmt.setContext(0);
+		assertFormatted();
+	}
+
 	public void testContext1() throws IOException {
 		init("X");
 		fmt.setContext(1);
-- 
1.6.3.rc4.190.g4648

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]