Debian Codegraph @

tests/ignore-matching-lines

raw
1 #!/bin/sh
2 # --ignore-matching-lines
3
4 # Bug reported by Vincent Lefevre in <http://bugs.gnu.org/16864>.
5
6 . "${srcdir=.}/init.sh"; path_prepend_ ../src
7
8 fail=0
9
10 cat <<'EOF' >a
11 1a
12 2
13 3a
14 4
15 5
16 6
17 EOF
18
19 cat <<'EOF' >b
20 1b
21 2
22 3b
23 4
24 5
25 6
26 7
27 EOF
28
29 cat <<'EOF' >exp
30 @@ -1,6 +1,7 @@
31 -1a
32 +1b
33 2
34 -3a
35 +3b
36 4
37 5
38 6
39 +7
40 EOF
41
42 returns_ 1 diff -u --ignore-matching-lines 3 a b >out 2>err || fail=1
43 sed 1,2d out >outtail || framework_failure+
44 compare exp outtail || fail=1
45
46 Exit $fail