Debian Codegraph @

tests/clean1/run-test

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