Debian Codegraph @

tests/flip1/run-test

raw
1 #!/bin/sh
2
3 # This is a flipdiff(1) testcase.
4 # Test: Patch2 reduces to nothing after flip.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > file.orig
10 a
11 b
12 c
13 EOF
14
15 cat << EOF > file
16 a
17 d
18 c
19 EOF
20
21 ${DIFF} -u file.orig file > patch1
22
23 mv -f file file.orig
24 cat << EOF > file
25 a
26 c
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,2 @@
37 a
38 -b
39 c
40
41 === 8< === cut here === 8< ===
42
43 EOF