Debian Codegraph @

tests/gendiff1/run-test

raw
1 #!/bin/sh
2
3 . ${top_srcdir-.}/tests/common.sh
4
5 mkdir dir
6 cat << EOF > dir/file.orig
7 a
8 b
9 EOF
10 cat << EOF > abc
11 a
12 b
13 c
14 EOF
15 cat << EOF > abd
16 a
17 b
18 d
19 EOF
20 cp abc dir/file
21 # "gendiff dir .orig" without requiring gendiff:
22 (printf "diff -up dir/file.orig dir/file\n"
23 diff -up dir/file.orig dir/file) > patch1
24
25 cp abd dir/file
26 (printf "diff -up dir/file.orig dir/file\n"
27 diff -up dir/file.orig dir/file) > patch2
28
29 ${INTERDIFF} patch1 patch2 2>errors > patch1-2 || exit 1
30 [ -s errors ] && exit 1
31 mkdir test
32 cp abc test/file
33 cd test
34 ${PATCH} -p1 < ../patch1-2 || exit 1
35 cd ..
36 cmp abd test/file || exit 1
37 cd test
38 ${PATCH} -R < ../patch1-2 || exit 1
39 cd ..
40 cmp abc test/file || exit 1