Debian Codegraph @

tests/trimcontext1/run-test

raw
1 #!/bin/sh
2
3 # This is a rediff(1) testcase.
4 # Test: Trim context from beginning and end of hunk.
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 trim me
14 blah
15 blah
16 -not
17 +important
18 blah
19 blah
20 trim me
21 EOF
22
23 sed -e '/^ trim me$/d' original-patch > edited-patch
24
25 ${REDIFF} original-patch edited-patch 2>errors >rediffed-patch || exit 1
26 [ -s errors ] && exit 1
27 cat << EOF | cmp - rediffed-patch || exit 1
28 --- file.orig
29 +++ file
30 @@ -7,5 +7,5 @@
31 blah
32 blah
33 -not
34 +important
35 blah
36 blah
37 EOF