Debian Codegraph @

tests/flip14/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 a
11 b
12 c
13 EOF
14
15 cat << EOF > file
16 a
17 a
18 d
19 c
20 EOF
21
22 ${DIFF} -u file.orig file > patch1
23
24 mv -f file file.orig
25 cat << EOF > file
26 d
27 c
28 a
29 a
30 EOF
31
32 ${DIFF} -u file.orig file > patch2
33
34 ${FLIPDIFF} patch1 patch2 > patch-flipped || exit 1
35 sed -e "s/$(printf '\t').*$//" patch-flipped > patch-cmp
36 cmp - patch-cmp << EOF || exit 1
37 --- file.orig
38 +++ file
39 @@ -1,4 +1,4 @@
40 -a
41 -a
42 b
43 c
44 +a
45 +a
46
47 === 8< === cut here === 8< ===
48
49 --- file.orig
50 +++ file
51 @@ -1,4 +1,4 @@
52 -b
53 +d
54 c
55 a
56 a
57 EOF