Debian Codegraph @

tests/select1/run-test

raw
1 #!/bin/sh
2
3 # This is a filterdiff(1) testcase.
4 # Test: Unified format, filename pattern but no selector
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > patch
10 --- a.orig
11 +++ a
12 @@ -1 +1 @@
13 -a
14 +b
15 --- b.orig
16 +++ b
17 @@ -1 +1 @@
18 -a
19 +b
20 --- c.orig
21 +++ c
22 @@ -1 +1 @@
23 -a
24 +b
25 EOF
26
27 ${FILTERDIFF} -i b <patch >selected 2>errors || exit 1
28 [ -s errors ] && exit 1
29
30 cat << EOF | cmp - selected || exit 1
31 --- b.orig
32 +++ b
33 @@ -1 +1 @@
34 -a
35 +b
36 EOF
37
38 cat << EOF > patterns
39 no
40 match
41 EOF
42
43 ${FILTERDIFF} -I patterns <patch >selected 2>errors || exit 1
44 [ -s errors ] && exit 1
45
46 cat << EOF | cmp - selected || exit 1
47 EOF
48
49 cat << EOF > patterns
50 not-a
51 b
52 not-c
53 EOF
54
55 ${FILTERDIFF} -I patterns <patch >selected 2>errors || exit 1
56 [ -s errors ] && exit 1
57
58 cat << EOF | cmp - selected || exit 1
59 --- b.orig
60 +++ b
61 @@ -1 +1 @@
62 -a
63 +b
64 EOF