Debian Codegraph @

tests/grepdiff3/run-test

raw
1 #!/bin/sh
2
3 # This is a grepdiff(1) testcase.
4
5
6 . ${top_srcdir-.}/tests/common.sh
7
8 cat << EOF > diff
9 --- file1
10 +++ file1
11 @@ -1 +1,2 @@
12 -A
13 +a
14 +b
15 @@ -10 +11,2 @@
16 -C
17 +c
18 +d
19 EOF
20
21 ${GREPDIFF} --output-matching=file 'c' diff 2>errors >file || exit 1
22 ${GREPDIFF} --output-matching=hunk 'c' diff 2>errors >hunk || exit 1
23 [ -s errors ] && exit 1
24
25 cat << EOF | cmp - file || exit 1
26 --- file1
27 +++ file1
28 @@ -1 +1,2 @@
29 -A
30 +a
31 +b
32 @@ -10 +11,2 @@
33 -C
34 +c
35 +d
36 EOF
37
38 cat << EOF | cmp - hunk || exit 1
39 --- file1
40 +++ file1
41 @@ -10 +10,2 @@
42 -C
43 +c
44 +d
45 EOF