Debian Codegraph @

tests/stdin/run-test

raw
1 #!/bin/sh
2
3 # This is an interdiff(1) testcase.
4 # Test: Test taking files in on stdin.
5
6 . ${top_srcdir-.}/tests/common.sh
7
8 cat << EOF > orig
9 a
10 b
11 c
12 EOF
13 cat << EOF > new1
14 a
15 b
16 EOF
17 cat << EOF > new2
18 a
19 b
20 d
21 EOF
22
23 ${DIFF} -u orig new1 > patch1
24 ${DIFF} -u orig new2 > patch2
25 ${INTERDIFF} patch1 patch2 2>errors > patch1-2.good || exit 1
26 [ -s errors ] && exit 1
27 ${INTERDIFF} patch1 - < patch2 2>errors > patch1-2.1 || exit 1
28 [ -s errors ] && exit 1
29 ${INTERDIFF} - patch2 < patch1 2>errors > patch1-2.2 || exit 1
30 [ -s errors ] && exit 1
31 cmp patch1-2.good patch1-2.1 || exit 1
32 cmp patch1-2.good patch1-2.2 || exit 1
33
34 # 2 stdins fail:
35 ${INTERDIFF} - - < patch1 2>errors > patch1-1 && exit 1 || true