Debian Codegraph @

tests/select11/run-test

raw
1 #!/bin/sh
2
3 # This is a filterdiff(1) testcase.
4 # Test: Context format, filename exclude pattern but no selector
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 *** 1 ****
21 ! a
22 --- 1 ----
23 ! b
24 *** c.orig
25 --- c
26 ***************
27 *** 1 ****
28 ! a
29 --- 1 ----
30 ! b
31 EOF
32
33 ${FILTERDIFF} -x b <patch >selected 2>errors || exit 1
34 [ -s errors ] && exit 1
35
36 cat << EOF | cmp - selected || exit 1
37 *** a.orig
38 --- a
39 ***************
40 *** 1 ****
41 ! a
42 --- 1 ----
43 ! b
44 *** c.orig
45 --- c
46 ***************
47 *** 1 ****
48 ! a
49 --- 1 ----
50 ! b
51 EOF
52
53 cat << EOF > patterns
54 no
55 match
56 EOF
57
58 ${FILTERDIFF} -X patterns <patch >selected 2>errors || exit 1
59 [ -s errors ] && exit 1
60
61 cmp patch selected || exit 1
62
63 cat << EOF > patterns
64 not-a
65 b
66 not-c
67 EOF
68
69 ${FILTERDIFF} -X patterns <patch >selected 2>errors || exit 1
70 [ -s errors ] && exit 1
71
72 cat << EOF | cmp - selected || exit 1
73 *** a.orig
74 --- a
75 ***************
76 *** 1 ****
77 ! a
78 --- 1 ----
79 ! b
80 *** c.orig
81 --- c
82 ***************
83 *** 1 ****
84 ! a
85 --- 1 ----
86 ! b
87 EOF