Debian Codegraph @

tests/addhunk2/run-test

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