Debian Codegraph @

tests/edit5/run-test

raw
1 #!/bin/sh
2
3 # This is a rediff(1) testcase.
4 # Test: Make a change in the first of two files.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 mkdir dir.orig dir
10 cat << EOF > dir.orig/file1
11 file1
12 EOF
13 cat << EOF > dir.orig/file2
14 file2
15 EOF
16 cat << EOF > dir/file1
17 IFLE1
18 EOF
19 cat << EOF > dir/file2
20 FILE2
21 EOF
22
23 ${DIFF} -u dir.orig dir > original-patch
24 sed -e 's/^+IFLE1$/+FILE1/' original-patch > edited-patch
25
26 ${REDIFF} original-patch edited-patch 2>errors >rediffed-patch || exit 1
27 [ -s errors ] && exit 1
28 cd dir.orig
29 ${PATCH} < ../rediffed-patch || exit 1
30 cat << EOF | cmp - file1 || exit 1
31 FILE1
32 EOF
33 cat << EOF | cmp - file2 || exit 1
34 FILE2
35 EOF