Debian Codegraph @

tests/lsdiff11/run-test

raw
1 #!/bin/sh
2
3 # This is a lsdiff(1) testcase.
4 # Test: See if lsdiff handles filenames with spaces with no tab sep.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > diff1
10 --- filename.orig Mon Dec 17 15:53:01 2001
11 +++ filename Thu Jan 1 01:00:00 1970
12 @@ -1 +0,0 @@
13 -(tabs -> spaces)
14 EOF
15
16 cat << EOF > diff2
17 --- file name.orig Mon Dec 17 15:53:01 2001
18 +++ file name Thu Jan 1 01:00:00 1970
19 @@ -1 +0,0 @@
20 -(tabs -> spaces, filename with space)
21 EOF
22
23 cat << EOF > diff3
24 --- spamthrottle/FILES Feb 2001 20:16:31 -0000 1.1.1.1
25 +++ spamthrottle/FILES Dec 2002 15:35:51 -0000 1.1.1.1.2.3
26 @@ -1 +0,0 @@
27 -(alternate date format)
28 EOF
29
30 cat << EOF > diff4
31 --- spam throttle/FILES Feb 2001 20:16:31 -0000 1.1.1.1
32 +++ spam throttle/FILES Dec 2002 15:35:51 -0000 1.1.1.1.2.3
33 @@ -1 +0,0 @@
34 -(alternate date format, filename with space)
35 EOF
36
37 cat << EOF > diff5
38 --- filename Fri, Jun 13 2003 12:22:00 +0100
39 +++ filename Fri, Jun 13 2003 12:22:00 +0100
40 @@ -1 +0,0 @@
41 -(unknown date format)
42 EOF
43
44 ${LSDIFF} -h diff1 diff2 diff3 diff4 diff5 2>errors >index || exit 1
45 [ -s errors ] && exit 1
46
47 cat << EOF | cmp - index || exit 1
48 filename
49 file name
50 spamthrottle/FILES
51 spam throttle/FILES
52 filename
53 EOF
54
55 ${LSDIFF} -H diff1 diff2 diff3 diff4 diff5 2>errors >index || exit 1
56 [ -s errors ] && exit 1
57
58 cat << EOF | cmp - index || exit 1
59 diff1:filename
60 diff2:file name
61 diff3:spamthrottle/FILES
62 diff4:spam throttle/FILES
63 diff5:filename
64 EOF