Debian Codegraph @

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