Debian Codegraph @

tests/select4/run-test

raw
1 #!/bin/sh
2
3 # This is a filterdiff(1) testcase.
4 # Test: Context format, line selector but no filename pattern
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 ----
23 ! b
24 *** c.orig
25 --- c
26 ***************
27 *** 3 ****
28 ! a
29 --- 3 ----
30 ! b
31 EOF
32
33 ${FILTERDIFF} --lines=2 <patch >selected 2>errors || exit 1
34 [ -s errors ] && exit 1
35
36 cat << EOF | cmp - selected || exit 1
37 *** b.orig
38 --- b
39 ***************
40 *** 2 ****
41 ! a
42 --- 2 ----
43 ! b
44 EOF