git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [JGIT PATCH 7/6] BROKEN: Add a zero line context test for diff.DiffFormatter
@ 2009-05-03  0:05 Shawn O. Pearce
  2009-05-03  0:14 ` [JGIT PATCH 8/6] Fix zero context insert and delete hunk headers to match CGit Shawn O. Pearce
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn O. Pearce @ 2009-05-03  0:05 UTC (permalink / raw)
  To: Robin Rosenberg, Johannes Schindelin; +Cc: git

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

 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-05-05 22:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-03  0:05 [JGIT PATCH 7/6] BROKEN: Add a zero line context test for diff.DiffFormatter Shawn O. Pearce
2009-05-03  0:14 ` [JGIT PATCH 8/6] Fix zero context insert and delete hunk headers to match CGit Shawn O. Pearce
2009-05-03  0:50   ` Miles Bader
2009-05-03  8:25     ` Robin Rosenberg
2009-05-03  8:31       ` Ferry Huberts (Pelagic)
2009-05-03  9:24         ` Robin Rosenberg
2009-05-03  9:29           ` Ferry Huberts (Pelagic)
2009-05-05 22:19           ` SZEDER Gábor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).