Debian Codegraph @

tests/flip4/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 b
25 c
26 d
27 e
28 f
29 g
30 h
31 i
32 j
33 k
34 l
35 EOF
36
37 ${DIFF} -u file.orig file > patch1
38
39 mv -f file file.orig
40 cat << EOF > file
41 b
42 c
43 d
44 e
45 f
46 g
47 h
48 i
49 j
50 k
51 EOF
52
53 ${DIFF} -u file.orig file > patch2
54
55 ${FLIPDIFF} patch1 patch2 > patch-flipped || exit 1
56 sed -e "s/$(printf '\t').*$//" patch-flipped > patch-cmp
57 cmp - patch-cmp << EOF || exit 1
58 --- file.orig
59 +++ file
60 @@ -9,4 +9,3 @@
61 i
62 j
63 k
64 -l
65
66 === 8< === cut here === 8< ===
67
68 --- file.orig
69 +++ file
70 @@ -1,4 +1,3 @@
71 -a
72 b
73 c
74 d
75 EOF