Debian Codegraph @

tests/addhunk1/run-test

raw
1 #!/bin/sh
2
3 # This is a rediff(1) testcase.
4 # Test: Add a hunk, filling in missing offsets and counts.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > original-patch
10 --- file.orig
11 +++ file
12 @@ -6,7 +6,7 @@
13 blah
14 blah
15 blah
16 -not
17 +important
18 blah
19 blah
20 blah
21 EOF
22
23 cat original-patch - << EOF > edited-patch
24 @@ -37
25 blah
26 blah
27 blah
28 +blah
29 blah
30 blah
31 blah
32 EOF
33
34 ${REDIFF} original-patch edited-patch 2>errors >rediffed-patch || exit 1
35 [ -s errors ] && exit 1
36 cat << EOF | cmp - rediffed-patch || exit 1
37 --- file.orig
38 +++ file
39 @@ -6,7 +6,7 @@
40 blah
41 blah
42 blah
43 -not
44 +important
45 blah
46 blah
47 blah
48 @@ -37,6 +37,7 @@
49 blah
50 blah
51 blah
52 +blah
53 blah
54 blah
55 blah
56 EOF