git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 3, 2009, 00:05 UTC
Message-ID
<20090503000540.GN23604@spearce.org>
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
Next: Shawn O. Pearce
Message 1 of 8 in “BROKEN: Add a zero line context test for diff.DiffFormatter”
  1. 7/6 BROKEN: Add a zero line context test for diff.DiffFormatterShawn O. Pearce, May 3, 2009
  2. 8/6 Fix zero context insert and delete hunk headers to match CGitShawn O. Pearce, May 3, 2009
  3. Miles BaderMay 3, 2009
  4. Robin RosenbergMay 3, 2009
  5. Ferry Huberts (Pelagic)May 3, 2009
  6. Robin RosenbergMay 3, 2009
  7. Ferry Huberts (Pelagic)May 3, 2009
  8. SZEDER GáborMay 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.