1
# Copyright (C) 2009 Free Software Foundation, Inc.
3
# Copying and distribution of this file, with or without modification,
4
# in any medium, are permitted without royalty provided the copyright
5
# notice and this notice are preserved.
7
# Test the --reject-format=FORMAT option
16
# ==============================================================
18
if ! patch --merge </dev/null 2>/dev/null ; then
19
echo "Merge support DISABLED; skipping this test"
23
# ==============================================================
30
while test $# -gt 0 -a "$1" != -- ; do
34
echo "$body" | sed$sed -e b > b
37
while test $# -gt 0 ; do
41
echo "$body" | sed$sed -e b > c
42
output=`diff -u a b | patch $ARGS -f --merge c`
44
echo "$output" | sed -e '/^\(\|patching file c\)$/d'
46
test $status == 0 || echo "Status: $status"
51
# ==============================================================
70
check 'x 3 2ib -- 3ic' <<EOF
79
# ==============================================================
81
check 'x 3 2c2b -- 2c2c' <<EOF
82
Hunk #1 NOT MERGED at 2-6.
93
check 'x 3 2d -- 2d' <<EOF
94
Hunk #1 already applied at 2.
99
check 'x 2 2ibc -- 2ibc' <<EOF
100
Hunk #1 already applied at 2.
106
check 'x 4 2aa 2aa -- 2aa 2aa' <<EOF
107
Hunk #1 already applied at 3-4.
116
# ==============================================================
118
check 'x 4 2d -- 3d' <<EOF
119
Hunk #1 NOT MERGED at 2-6.
130
check 'x 4 3d -- 2d' <<EOF
131
Hunk #1 NOT MERGED at 2-6.
142
# ==============================================================
144
check 'x 3 3ib -- 2d' <<EOF
145
Hunk #1 NOT MERGED at 2-6.
156
check 'x 3 2d -- 3ib' <<EOF
157
Hunk #1 NOT MERGED at 2-6.
168
# ==============================================================
170
check 'x 1 1cb -- 1cc' <<EOF
171
Hunk #1 NOT MERGED at 1-4.
180
check 'x 4 2ca 3cb -- 2ca 3cc' <<EOF
181
Hunk #1 NOT MERGED at 3-7.
193
check 'x 6 3c3b 4c4b -- 3c3c 4c4c' <<EOF
194
Hunk #1 NOT MERGED at 3-9.
209
check 'x 4 2cb 3ca -- 2cc 3ca' <<EOF
210
Hunk #1 NOT MERGED at 2-6.
222
check 'x 3 2ib 3ib -- 2ic' <<EOF
223
Hunk #1 NOT MERGED at 2-6, merged at 8.
236
check 'x 3 2ib 3ib 3ib -- 2ic' <<EOF
237
Hunk #1 NOT MERGED at 2-6, merged at 8-9.
251
check 'x 9 4ca 5cb 6ca -- 4ca 5cc 6ca' <<EOF
252
Hunk #1 NOT MERGED at 5-9.
269
check 'x 3 2ib 3ib -- 1i0' <<EOF
278
check 'x 4 2ib 4ib -- 1i0 3ic' <<EOF
279
Hunk #1 merged at 3,7.
290
# ==============================================================
292
check 'x 5 2,4d -- 3c3c' <<EOF
293
Hunk #1 NOT MERGED at 2-7.
305
check 'x 5 3c3c -- 2,4d' <<EOF
306
Hunk #1 NOT MERGED at 2-7.
318
# ==============================================================
320
check 'x 3 1,2d -- 2ic' <<EOF
321
Hunk #1 NOT MERGED at 1-6.
332
check 'x 3 2ic -- 1,2d' <<EOF
333
Hunk #1 NOT MERGED at 1-6.