| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
. ${top_srcdir-.}/tests/common.sh |
| 4 |
|
| 5 |
mkdir dir |
| 6 |
cat << EOF > dir/file.orig |
| 7 |
-- |
| 8 |
foo |
| 9 |
bar |
| 10 |
baz |
| 11 |
bing |
| 12 |
bong |
| 13 |
bang |
| 14 |
crash |
| 15 |
wallop |
| 16 |
EOF |
| 17 |
cat << EOF > new1 |
| 18 |
-- |
| 19 |
foo |
| 20 |
bar |
| 21 |
baz |
| 22 |
bing |
| 23 |
bong |
| 24 |
bang |
| 25 |
crash |
| 26 |
wallop |
| 27 |
EOF |
| 28 |
cat << EOF > new2 |
| 29 |
b |
| 30 |
foo |
| 31 |
bar |
| 32 |
baz |
| 33 |
bing |
| 34 |
bong |
| 35 |
bang |
| 36 |
crash |
| 37 |
wallop |
| 38 |
thump |
| 39 |
EOF |
| 40 |
|
| 41 |
cp new1 dir/file |
| 42 |
${DIFF} -u dir/file.orig dir/file > patch1 |
| 43 |
mkdir dir.modified |
| 44 |
mv dir/file.orig dir/file |
| 45 |
cp new2 dir.modified/file |
| 46 |
${DIFF} -urN dir dir.modified > patch2 |
| 47 |
${INTERDIFF} patch1 patch2 2>errors > patch1-2 || exit 1 |
| 48 |
[ -s errors ] && exit 1 |
| 49 |
mkdir test |
| 50 |
cp new1 test/file |
| 51 |
cd test |
| 52 |
${PATCH} < ../patch1-2 || exit 1 |
| 53 |
cd .. |
| 54 |
cmp new2 test/file || exit 1 |