Debian Codegraph @

tests/combine2/run-test

raw
1 #!/bin/bash
2
3 # This is a combinediff(1) testcase.
4
5
6 . ${top_srcdir-.}/tests/common.sh
7
8 cat << EOF > patch1
9 --- file.orig
10 +++ file
11 @@ -1 +1 @@
12 -a
13 +b
14 --- otherfile.orig
15 +++ otherfile
16 @@ -1,2 +1 @@
17 -a
18 -b
19 +A
20 @@ -3 +2,2 @@
21 -c
22 +B
23 +C
24 EOF
25 cat << EOF > patch2
26 --- file.orig
27 +++ file
28 @@ -1 +1 @@
29 -b
30 +c
31 EOF
32
33 ${COMBINEDIFF} patch1 patch2 2>errors >patches || exit 1
34 [ -s errors ] && exit 1
35
36 echo a > file
37 (echo a; echo b; echo c) > otherfile
38 ${PATCH} < patches || exit 1
39 echo c > c
40 cmp file c || exit 1
41 (echo A; echo B; echo C) > abc
42 cmp otherfile abc || exit 1