Debian Codegraph @

tests/convert2/run-test

raw
1 #!/bin/sh
2
3 # This is a filterdiff(1) testcase.
4 # Test: Convert unified to context.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 mkdir dir.orig dir
10 cat <<EOF > dir.orig/a
11 a
12 b
13 c
14 .
15 .
16 .
17 .
18 .
19 .
20 .
21 c
22 b
23 a
24 EOF
25 cat <<EOF > dir.orig/b
26 b
27 c
28 d
29 EOF
30 cat <<EOF > dir/a
31 a
32 B
33 c
34 .
35 .
36 .
37 .
38 .
39 .
40 .
41 c
42 B
43 a
44 EOF
45 cat <<EOF > dir/b
46 b
47 C
48 d
49 EOF
50 ${DIFF} -ru dir.orig dir > cdiff
51
52 ${FILTERDIFF} --format=context cdiff 2>errors > diff || exit 1
53 [ -s errors ] && exit 1
54
55 cd dir.orig
56 ${PATCH} -p1 -i ../diff 2>errors || exit 1
57 [ -s errors ] && exit 1
58
59 cmp a - <<EOF || exit 1
60 a
61 B
62 c
63 .
64 .
65 .
66 .
67 .
68 .
69 .
70 c
71 B
72 a
73 EOF
74 cmp b - <<EOF || exit 1
75 b
76 C
77 d
78 EOF