Debian Codegraph @

tests/select6/run-test

raw
1 #!/bin/sh
2
3 # This is a filterdiff(1) testcase.
4 # Test: Context format, --hunks but no -i or -x
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > patch
10 *** a.orig
11 --- a
12 ***************
13 *** 1 ****
14 ! a
15 --- 1 ----
16 ! b
17 *** b.orig
18 --- b
19 ***************
20 *** 2 ****
21 ! a
22 --- 2,3 ----
23 ! b
24 + c
25 *** 50 ****
26 ! a
27 --- 51 ----
28 ! b
29 *** c.orig
30 --- c
31 ***************
32 *** 3 ****
33 ! a
34 --- 3 ----
35 ! b
36 EOF
37
38 ${FILTERDIFF} --hunks=2 <patch >selected 2>errors || exit 1
39 [ -s errors ] && exit 1
40
41 cat << EOF | cmp - selected || exit 1
42 *** b.orig
43 --- b
44 ***************
45 *** 50 ****
46 ! a
47 --- 50 ----
48 ! b
49 EOF