Debian Codegraph @

tests/lsdiff9/run-test

raw
1 #!/bin/sh
2
3 # This is a lsdiff(1) testcase.
4 # Test: -nv output format, context input
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > diff
10 *** file1
11 --- file1
12 ***************
13 *** 0 ****
14 --- 1 ----
15 + a
16 *** 60 ****
17 ! a
18 --- 60 ----
19 ! b
20 *** orig/file2
21 --- file2
22 ***************
23 *** 0 ****
24 --- 1 ----
25 + a
26 *** file3
27 --- file3.orig
28 ***************
29 *** 0 ****
30 --- 1 ----
31 + a
32 EOF
33
34 ${LSDIFF} -nv diff 2>errors >index || exit 1
35 [ -s errors ] && exit 1
36
37 cat << EOF | cmp - index || exit 1
38 1 file1
39 4 Hunk #1
40 7 Hunk #2
41 11 file2
42 14 Hunk #1
43 17 file3
44 20 Hunk #1
45 EOF