Debian Codegraph @

tests/trimlast1/run-test

raw
1 #!/bin/sh
2
3 # This is an interdiff(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 1
15 2
16 3
17 -3
18 +4
19 5
20 6
21 7
22 EOF
23
24 cat <<EOF > patch2
25 --- file.orig
26 +++ file
27 @@ -1,8 +1,9 @@
28 1
29 2
30 3
31 -3
32 +4
33 5
34 6
35 7
36 8
37 +9
38 EOF
39
40 ${INTERDIFF} patch1 patch2 > patch1-2 2>errors || exit 1
41 [ -s errors ] && exit 1
42
43 cat << EOF | cmp - patch1-2 || exit 1
44 diff -u file file
45 --- file
46 +++ file
47 @@ -6,3 +6,4 @@
48 6
49 7
50 8
51 +9
52 EOF