From: "Shawn O. Pearce" <spearce@spearce.org>
To: Robin Rosenberg <robin.rosenberg@dewire.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: [JGIT PATCH 7/6] BROKEN: Add a zero line context test for diff.DiffFormatter
Date: Sat, 2 May 2009 17:05:40 -0700 [thread overview]
Message-ID: <20090503000540.GN23604@spearce.org> (raw)
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 reply other threads:[~2009-05-03 0:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-03 0:05 Shawn O. Pearce [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090503000540.GN23604@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=robin.rosenberg@dewire.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).