Debian Codegraph @

tests/rediff2/run-test

raw
1 #!/bin/sh
2
3 # This is a rediff(1) testcase.
4 # Test: Don't segfault when changes are made outside the diff.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << "EOF" > patch.orig
10 Index: file
11 ===================================================================
12 --- file
13 +++ file
14 @@ -3,3 +3,4 @@
15 1
16 2
17 3
18 +4.5
19 EOF
20
21 cat << "EOF" > patch.mod
22 # this change is invalid
23 Index: file
24 ===================================================================
25 --- file
26 +++ file
27 @@ -3,3 +3,4 @@
28 1
29 2
30 3
31 +4.5
32 EOF
33
34 ${REDIFF} patch.orig patch.mod > patch-rediffed 2>stderr && exit 1
35 [ $? = 1 ] || exit 1
36 exit 0