OSDN Git Service

PMA extracting sources were licensed under the MIT license
[lha/lha.git] / tests / lha-test8
1 # -*- shell-script -*-
2 message testing timestamp
3 # level 0 header
4 $lha c0 test-tmp-h0.lzh test-[abc]
5                                                         check $? $LINENO
6 # show time stamp
7 $lha vv test-tmp-h0.lzh
8 ls -l test-[abc]
9
10 $lha xw=test-tmp-h0 test-tmp-h0.lzh
11                                                         check $? $LINENO
12 diff -r test-1 test-tmp-h0
13                                                         check $? $LINENO
14 test test-a -nt test-tmp-h0/test-a ||
15 test test-a -ot test-tmp-h0/test-a ||
16 test test-b -nt test-tmp-h0/test-b ||
17 test test-b -ot test-tmp-h0/test-b ||
18 test test-c -nt test-tmp-h0/test-c ||
19 test test-c -ot test-tmp-h0/test-c
20 test $? -ne 0
21                                                         check $? $LINENO
22
23 # level 1 header
24 $lha c1 test-tmp-h1.lzh test-[abc]
25                                                         check $? $LINENO
26 # show time stamp
27 $lha vv test-tmp-h1.lzh
28 ls -l test-[abc]
29
30 $lha xw=test-tmp-h1 test-tmp-h1.lzh
31                                                         check $? $LINENO
32 diff -r test-1 test-tmp-h1
33                                                         check $? $LINENO
34 test test-a -nt test-tmp-h1/test-a ||
35 test test-a -ot test-tmp-h1/test-a ||
36 test test-b -nt test-tmp-h1/test-b ||
37 test test-b -ot test-tmp-h1/test-b ||
38 test test-c -nt test-tmp-h1/test-c ||
39 test test-c -ot test-tmp-h1/test-c
40 test $? -ne 0
41                                                         check $? $LINENO
42
43 # level 2 header
44 $lha c1 test-tmp-h2.lzh test-[abc]
45                                                         check $? $LINENO
46 # show time stamp
47 $lha vv test-tmp-h2.lzh
48 ls -l test-[abc]
49
50 $lha xw=test-tmp-h2 test-tmp-h2.lzh
51                                                         check $? $LINENO
52 diff -r test-1 test-tmp-h2
53                                                         check $? $LINENO
54 test test-a -nt test-tmp-h2/test-a ||
55 test test-a -ot test-tmp-h2/test-a ||
56 test test-b -nt test-tmp-h2/test-b ||
57 test test-b -ot test-tmp-h2/test-b ||
58 test test-c -nt test-tmp-h2/test-c ||
59 test test-c -ot test-tmp-h2/test-c
60 test $? -ne 0
61                                                         check $? $LINENO
62
63 # Note: level 0, 1 header (generic) format use the MS-DOS `ftime'
64 # structure, so it cannot save odd seconds.
65
66 # set even seconds timestamp
67 cp test-a test-tmp-a &&
68 cp test-b test-tmp-b &&
69 cp test-c test-tmp-c &&
70 change_timestamp 01020304.02 test-tmp-a &&
71 change_timestamp 01020304.04 test-tmp-b &&
72 change_timestamp 01020304.06 test-tmp-c
73                                                         check $? $LINENO
74
75 # level 0 header (generic)
76 $lha cg0 test-tmp-hg0.lzh test-tmp-[abc]
77                                                         check $? $LINENO
78 # show time stamp
79 $lha vv test-tmp-hg0.lzh
80 ls -l test-tmp-[abc]
81
82 $lha xw=test-tmp-hg0 test-tmp-hg0.lzh
83                                                         check $? $LINENO
84 diff test-tmp-a test-tmp-hg0/test-tmp-a &&
85 diff test-tmp-b test-tmp-hg0/test-tmp-b &&
86 diff test-tmp-c test-tmp-hg0/test-tmp-c
87                                                         check $? $LINENO
88 test test-tmp-a -nt test-tmp-hg0/test-tmp-a ||
89 test test-tmp-a -ot test-tmp-hg0/test-tmp-a ||
90 test test-tmp-b -nt test-tmp-hg0/test-tmp-b ||
91 test test-tmp-b -ot test-tmp-hg0/test-tmp-b ||
92 test test-tmp-c -nt test-tmp-hg0/test-tmp-c ||
93 test test-tmp-c -ot test-tmp-hg0/test-tmp-c
94 test $? -ne 0
95                                                         check $? $LINENO
96
97 # level 1 header (generic)
98 $lha cg1 test-tmp-hg1.lzh test-tmp-[abc]
99                                                         check $? $LINENO
100 # show time stamp
101 $lha vv test-tmp-hg1.lzh
102 ls -l test-tmp-[abc]
103
104 $lha xw=test-tmp-hg1 test-tmp-hg1.lzh
105                                                         check $? $LINENO
106 diff test-tmp-a test-tmp-hg0/test-tmp-a &&
107 diff test-tmp-b test-tmp-hg0/test-tmp-b &&
108 diff test-tmp-c test-tmp-hg0/test-tmp-c
109                                                         check $? $LINENO
110 test test-tmp-a -nt test-tmp-hg1/test-tmp-a ||
111 test test-tmp-a -ot test-tmp-hg1/test-tmp-a ||
112 test test-tmp-b -nt test-tmp-hg1/test-tmp-b ||
113 test test-tmp-b -ot test-tmp-hg1/test-tmp-b ||
114 test test-tmp-c -nt test-tmp-hg1/test-tmp-c ||
115 test test-tmp-c -ot test-tmp-hg1/test-tmp-c
116 test $? -ne 0
117                                                         check $? $LINENO