Debian Codegraph @

tests/flip7/run-test

raw
1 #!/bin/sh
2
3 # This is a flipdiff(1) testcase.
4
5
6 . ${top_srcdir-.}/tests/common.sh
7
8 cat << EOF > file.orig
9 a
10 b
11 c
12 d
13 e
14 f
15 g
16 h
17 i
18 j
19 k
20 l
21 EOF
22
23 cat << EOF > file
24 a
25 b
26 apple
27 banana
28 cat
29 dog
30 d
31 e
32 f
33 g
34 h
35 i
36 j
37 k
38 l
39 EOF
40
41 ${DIFF} -u file.orig file > patch1
42
43 mv -f file file.orig
44 cat << EOF > file
45 a
46 b
47 elephant
48 apple
49 banana
50 cat
51 dog
52 d
53 e
54 f
55 g
56 h
57 i
58 j
59 k
60 l
61 EOF
62
63 ${DIFF} -u file.orig file > patch2
64
65 ${FLIPDIFF} patch1 patch2 > patch-flipped || exit 1
66 sed -e "s/$(printf '\t').*$//" patch-flipped > patch-cmp
67 cmp - patch-cmp << EOF || exit 1
68 --- file.orig
69 +++ file
70 @@ -1,5 +1,6 @@
71 a
72 b
73 +elephant
74 c
75 d
76 e
77
78 === 8< === cut here === 8< ===
79
80 --- file.orig
81 +++ file
82 @@ -1,7 +1,10 @@
83 a
84 b
85 elephant
86 -c
87 +apple
88 +banana
89 +cat
90 +dog
91 d
92 e
93 f
94 EOF