File: run-test

package info (click to toggle)
patchutils 0.3.1-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,480 kB
  • ctags: 279
  • sloc: sh: 6,676; ansic: 5,891; xml: 2,215; perl: 398; makefile: 259
file content (64 lines) | stat: -rwxr-xr-x 1,419 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh

# This is a lsdiff(1) testcase.
# Test: See if lsdiff handles filenames with spaces with no tab sep.


. ${top_srcdir-.}/tests/common.sh

cat << EOF > diff1
--- filename.orig      Mon Dec 17 15:53:01 2001
+++ filename   Thu Jan  1 01:00:00 1970
@@ -1 +0,0 @@
-(tabs -> spaces)
EOF

cat << EOF > diff2
--- file name.orig      Mon Dec 17 15:53:01 2001
+++ file name   Thu Jan  1 01:00:00 1970
@@ -1 +0,0 @@
-(tabs -> spaces, filename with space)
EOF

cat << EOF > diff3
--- spamthrottle/FILES Feb 2001 20:16:31 -0000	1.1.1.1
+++ spamthrottle/FILES Dec 2002 15:35:51 -0000	1.1.1.1.2.3
@@ -1 +0,0 @@
-(alternate date format)
EOF

cat << EOF > diff4
--- spam throttle/FILES Feb 2001 20:16:31 -0000	1.1.1.1
+++ spam throttle/FILES Dec 2002 15:35:51 -0000	1.1.1.1.2.3
@@ -1 +0,0 @@
-(alternate date format, filename with space)
EOF

cat << EOF > diff5
--- filename Fri, Jun 13 2003 12:22:00 +0100
+++ filename Fri, Jun 13 2003 12:22:00 +0100
@@ -1 +0,0 @@
-(unknown date format)
EOF

${LSDIFF} -h diff1 diff2 diff3 diff4 diff5 2>errors >index || exit 1
[ -s errors ] && exit 1

cat << EOF | cmp - index || exit 1
filename
file name
spamthrottle/FILES
spam throttle/FILES
filename
EOF

${LSDIFF} -H diff1 diff2 diff3 diff4 diff5 2>errors >index || exit 1
[ -s errors ] && exit 1

cat << EOF | cmp - index || exit 1
diff1:filename
diff2:file name
diff3:spamthrottle/FILES
diff4:spam throttle/FILES
diff5:filename
EOF