Debian Codegraph @

tests/trimlast2/run-test

raw
1 #!/bin/sh
2
3 # This is an combinediff(1) testcase.
4 # Test: Final hunk should retain 'earlier' context.
5 # https://fedorahosted.org/patchutils/ticket/32
6
7
8 . ${top_srcdir-.}/tests/common.sh
9
10 cat << EOF > patch1
11 --- file.orig
12 +++ file
13 @@ -1,7 +1,7 @@
14 -0
15 +1
16 2
17 3
18 4
19 5
20 6
21 7
22 EOF
23
24 cat <<EOF > patch2
25 --- file.orig
26 +++ file
27 @@ -6,3 +6,4 @@
28 6
29 7
30 8
31 +9
32 EOF
33
34 ${COMBINEDIFF} patch1 patch2 > patch12 2>errors || exit 1
35 [ -s errors ] && exit 1
36
37 cat << EOF | cmp - patch12 || exit 1
38 diff -u file.orig file
39 --- file.orig
40 +++ file
41 @@ -1,4 +1,4 @@
42 -0
43 +1
44 2
45 3
46 4
47 @@ -6,3 +6,4 @@
48 6
49 7
50 8
51 +9
52 EOF