Skip to content

Commit ed4691a

Browse files
committed
Add test to show failure described in twaugh#12
1 parent ac704f6 commit ed4691a

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,15 @@ TESTS = tests/newline1/run-test \
221221
tests/fullheader1/run-test \
222222
tests/fullheader2/run-test \
223223
tests/fullheader3/run-test \
224+
tests/fullheader4/run-test \
224225
tests/whitespace/run-test
225226

226227
# These ones don't work yet.
227228
# Feel free to send me patches. :-)
228229
XFAIL_TESTS = \
229230
tests/delhunk5/run-test \
230-
tests/delhunk6/run-test
231+
tests/delhunk6/run-test \
232+
tests/fullheader4/run-test
231233

232234
distclean-local:
233235
-rm -rf $(top_builddir)/test-arena

tests/fullheader4/run-test

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
# This is a filterdiff(1) testcase.
4+
# Handle git format-patch output when stripping pathname components
5+
# From: https://github.com/twaugh/patchutils/issues/12
6+
7+
. ${top_srcdir-.}/tests/common.sh
8+
9+
cat <<"EOF" > git-output
10+
diff --git a/test.txt b/test.txt
11+
index 257cc56..5716ca5 100644
12+
--- a/test.txt
13+
+++ b/test.txt
14+
@@ -1 +1 @@
15+
-foo
16+
+bar
17+
EOF
18+
19+
${FILTERDIFF} --strip=1 git-output 2>errors >output || { cat errors; exit 1; }
20+
[ -s errors ] && { cat errors; exit 1; }
21+
cmp output <<"EOF" || exit 1
22+
diff --git a/test.txt b/test.txt
23+
index 257cc56..5716ca5 100644
24+
--- test.txt
25+
+++ test.txt
26+
@@ -1 +1 @@
27+
-foo
28+
+bar
29+
EOF
30+
exit 0

0 commit comments

Comments
 (0)