| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# This is a combinediff(1) testcase. |
| 4 |
|
| 5 |
|
| 6 |
. ${top_srcdir-.}/tests/common.sh |
| 7 |
|
| 8 |
cat << EOF > file.orig |
| 9 |
a |
| 10 |
b |
| 11 |
c |
| 12 |
d |
| 13 |
e |
| 14 |
f |
| 15 |
g |
| 16 |
h |
| 17 |
i |
| 18 |
j |
| 19 |
k |
| 20 |
l |
| 21 |
m |
| 22 |
n |
| 23 |
o |
| 24 |
p |
| 25 |
q |
| 26 |
r |
| 27 |
s |
| 28 |
t |
| 29 |
u |
| 30 |
v |
| 31 |
w |
| 32 |
x |
| 33 |
y |
| 34 |
z |
| 35 |
EOF |
| 36 |
cp file.orig file.a-z |
| 37 |
cat << EOF > file |
| 38 |
b |
| 39 |
c |
| 40 |
d |
| 41 |
e |
| 42 |
f |
| 43 |
g |
| 44 |
h |
| 45 |
i |
| 46 |
j |
| 47 |
k |
| 48 |
l |
| 49 |
n |
| 50 |
o |
| 51 |
p |
| 52 |
q |
| 53 |
r |
| 54 |
s |
| 55 |
t |
| 56 |
u |
| 57 |
v |
| 58 |
w |
| 59 |
x |
| 60 |
y |
| 61 |
EOF |
| 62 |
|
| 63 |
${DIFF} -u file.orig file > patch1 |
| 64 |
mv -f file file.orig |
| 65 |
cat << EOF > file |
| 66 |
b |
| 67 |
c |
| 68 |
one |
| 69 |
d |
| 70 |
e |
| 71 |
f |
| 72 |
g |
| 73 |
h |
| 74 |
i |
| 75 |
j |
| 76 |
k |
| 77 |
l |
| 78 |
two |
| 79 |
n |
| 80 |
o |
| 81 |
p |
| 82 |
q |
| 83 |
r |
| 84 |
s |
| 85 |
t |
| 86 |
u |
| 87 |
v |
| 88 |
w |
| 89 |
x |
| 90 |
three |
| 91 |
y |
| 92 |
EOF |
| 93 |
${DIFF} -u file.orig file > patch2 |
| 94 |
|
| 95 |
${COMBINEDIFF} patch1 patch2 2>errors >patches || exit 1 |
| 96 |
[ -s errors ] && exit 1 |
| 97 |
|
| 98 |
# There should be no fuzz. |
| 99 |
patch file.a-z < patches >fuzz || exit 1 |
| 100 |
[ -s errors ] && exit 1 |
| 101 |
exit 0 |