Debian Codegraph @

tests/filterp/run-test

raw
1 #!/bin/sh
2
3 # This is a filterdiff(1) testcase.
4 # Test: Use -p in filter mode.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > diff
10 --- a/not-this/file1
11 +++ b/not-this/file1
12 @@ -0,0 +1 @@
13 +a
14 --- a/file1
15 +++ b/file1
16 @@ -0,0 +1 @@
17 +a
18 EOF
19
20 ${FILTERDIFF} -p1 -i file1 diff 2>errors >filtered || exit 1
21 [ -s errors ] && exit 1
22
23 cat << EOF | cmp - filtered || exit 1
24 --- a/file1
25 +++ b/file1
26 @@ -0,0 +1 @@
27 +a
28 EOF