Debian Codegraph @

tests/lsdiff5/run-test

raw
1 #!/bin/sh
2
3 # This is a lsdiff(1) testcase.
4 # Test: Different context output styles.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > diff1
10 *** file.orig Wed Mar 20 10:08:24 2002
11 --- file Wed Mar 20 10:08:24 2002
12 ***************
13 *** 1,7 ****
14 a
15 b
16 c
17 ! d
18 e
19 f
20 g
21 --- 1,7 ----
22 a
23 b
24 c
25 ! D
26 e
27 f
28 g
29 ***************
30 *** 9,15 ****
31 i
32 j
33 k
34 ! l
35 m
36 n
37 o
38 --- 9,15 ----
39 i
40 j
41 k
42 ! L
43 m
44 n
45 o
46 ***************
47 *** 21,23 ****
48 --- 21,26 ----
49 u
50 v
51 w
52 + x
53 + y
54 + z
55 EOF
56
57 (IFS=\
58
59 first=1
60 while read line;
61 do
62 if test "x$line" = "x***************"
63 then
64 if test $first -eq 0
65 then
66 continue
67 fi
68 first=0
69 fi
70 echo "$line"
71 done) < diff1 > diff2
72
73 ${LSDIFF} diff1 2>errors >index1 || exit 1
74 [ -s errors ] && exit 1
75
76 ${LSDIFF} diff2 2>errors >index2 || exit 1
77 [ -s errors ] && exit 1
78
79 cat << EOF | cmp - index1 || exit 1
80 file
81 EOF
82 cat << EOF | cmp - index2 || exit 1
83 file
84 EOF