aboutsummaryrefslogtreecommitdiff
path: root/suites/preprocess.py
blob: b7ddddf138ff934d36f98664bd6c5c383b1c6909 (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# ############################################################################ #
#                                                                              #
#                                                         :::      ::::::::    #
#    preprocess.py                                      :+:      :+:    :+:    #
#                                                     +:+ +:+         +:+      #
#    By: charles <charles.cabergs@gmail.com>        +#+  +:+       +#+         #
#                                                 +#+#+#+#+#+   +#+            #
#    Created: 2020/07/15 18:25:00 by charles           #+#    #+#              #
#    Updated: 2020/08/19 17:08:59 by charles          ###   ########.fr        #
#                                                                              #
# ############################################################################ #

import config
from suite import suite

@suite
def suite_quote(test):
    test("'echo' 'bonjour'")
    test("'echo' 'je' 'suis' 'charles'")

    test('"echo" "bonjour"')
    test('"echo" "je" "suis" "charles"')

    test('echo je\'suis\'"charles"')
    test('echo "je"suis\'charles\'')
    test('echo \'je\'"suis"charles')

    test('echo "\\""')
    test('echo "\\$"')
    test('echo "\\\\"')

    test('ls ""')
    test("ls ''")

    test('ls "" "" "" \'\' """"')
    test("ls '' '' '''' ''")

    test("'     echo' bonjour")
    test("'echo     ' bonjour")
    test('"     echo" bonjour')
    test('"echo     " bonjour')

    test("''echo bonjour")
    test('""echo bonjour')
    test("''''''''''''''''''''''''''''''''''''''''''''''''''''''''''echo bonjour")
    test('""""""""""""""""""""""""""""""""""""""""""""""""""""""""""echo bonjour')
    test("echo'' bonjour")
    test('echo"" bonjour')
    test("echo'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' bonjour")
    test('echo"""""""""""""""""""""""""""""""""""""""""""""""""""""""""" bonjour')
    test("ec''ho bonjour")
    test('ec""ho bonjour')
    test("ec''''''''''''''''''''''''''''''''''''''''''''''''''''''''''ho bonjour")
    test('ec""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ho bonjour')

    test("'''''''e''''''''''c''''''''''''h''''''''o''''''''''''''''''''' bonjour")
    test('"""""""e""""""""""c""""""""""""h""""""""o""""""""""""""""""""" bonjour')

@suite
def suite_interpolation(test):
    test("echo $TEST", exports={"TEST": "bonjour"})
    test("echo $TES", exports={"TEST": "bonjour"})
    test("echo $TEST_", exports={"TEST": "bonjour"})

    test('echo "|$TEST|"', exports={"TEST": "bonjour"})
    test('echo "|$TES|"', exports={"TEST": "bonjour"})
    test('echo "|$TEST_|"', exports={"TEST": "bonjour"})

    test("echo '|$TEST|'", exports={"TEST": "bonjour"})
    test("echo '|$TES|'", exports={"TEST": "bonjour"})
    test("echo '|$TEST_|'", exports={"TEST": "bonjour"})

    test("echo $A$B$C", exports={"A": "foo", "B": "bar", "C": "baz"})
    test('echo "$A$B$C"', exports={"A": "foo", "B": "bar", "C": "baz"})
    test("echo '$A$B$C'", exports={"A": "foo", "B": "bar", "C": "baz"})

    test("echo $A,$B,$C", exports={"A": "foo", "B": "bar", "C": "baz"})
    test('echo "$A,$B,$C"', exports={"A": "foo", "B": "bar", "C": "baz"})
    test("echo '$A,$B,$C'", exports={"A": "foo", "B": "bar", "C": "baz"})

    test('echo $A"$B"$C"A"$B"$C"', exports={"A": "foo", "B": "bar", "C": "baz"})
    test("echo $A'$B'$C'A'$B'$C'", exports={"A": "foo", "B": "bar", "C": "baz"})

    test('echo $A"$B"$C"A"$B"$C"', exports={"A": "foo ", "B": " bar  ", "C": "baz "})
    test("echo $A'$B'$C'A'$B'$C'", exports={"A": "foo ", "B": " bar  ", "C": "baz "})

    test("echo [$A]", exports={"A": r"bonjour\je"})
    test("echo [$A]", exports={"A": r"\b\\o\\\nj\\\\\\\our\\je\\\\"})
    test("echo [$A]", exports={"A": r"   \b\\o\\\nj\\\\\\\our\\je\\\\"})
    test("echo [$A]", exports={"A": r"\b\\o\\\nj\\\\\\\our\\je\\\\   "})
    test("echo [$A]", exports={"A": r"  \b\\o\\\nj\\\\\\\our\\je\\\\ "})
    test("echo [$A]", exports={"A": r"a  \b\\o\\\nj\\\\\\\our\\je\\\\ b"})
    test("echo [$A]", exports={"A": r" a  \b\\o\\\nj\\\\\\\our\\je\\\\ b "})
    test("echo [$A]", exports={"A": r" "})
    test("echo [$A]", exports={"A": r"    "})
    test("echo [$A]", exports={"A": r"\ "})
    test("echo [$A]", exports={"A": r" \  "})

    test(r"echo \ \ \ \ \ \ \ $A\ \ \ \ \ \ ", exports={"A": "bonjour"})
    test(r"echo \ \ \ \ \ \ \ $A\ \ \ \ \ \ ", exports={"A": "bonjour je suis"})
    test(r"echo \ \ \ \ \ \ \ $A\ \ \ \ \ \ ", exports={"A": "  bonjour je suis  "})

    test('echo $A', exports={"A": "bonjour je suis splited"})
    test('echo $A', exports={"A": "bonjour     je     suis    splited"})
    test('echo $A', exports={"A": "   bonjour     je     suis    splited   "})
    test('echo [$A]', exports={"A": "bonjour je suis splited"})
    test('echo [$A]', exports={"A": "bonjour     je     suis    splited"})
    test('echo [$A]', exports={"A": "   bonjour     je     suis    splited   "})
    test('echo "[$A]"', exports={"A": "bonjour je suis splited"})
    test('echo "[$A]"', exports={"A": "bonjour     je     suis    splited"})
    test('echo "[$A]"', exports={"A": "   bonjour     je     suis    splited   "})
    test('echo \ $A', exports={"A": "bonjour je suis splited"})
    test('echo \ $A', exports={"A": "bonjour     je     suis    splited"})
    test('echo \ $A', exports={"A": "   bonjour     je     suis    splited   "})
    test('echo $A\ ', exports={"A": "bonjour je suis splited"})
    test('echo $A\ ', exports={"A": "bonjour     je     suis    splited"})
    test('echo $A\ ', exports={"A": "   bonjour     je     suis    splited   "})
    test('echo $A$A$A', exports={"A": "   bonjour     je     suis    splited   "})
    test("echo $A",   exports={"A": "'" + config.LOREM + "'"})
    test('echo "$A"', exports={"A": "'" + config.LOREM + "'"})
    test("echo '$A'", exports={"A": "'" + config.LOREM + "'"})

    test("$ECHO $ECHO", exports={"ECHO": "echo"})
    test("$A$B bonjour", exports={"A": "ec", "B": "ho"})

    test("$LS", exports={"LS": "ls -l"}, setup="touch a b c")

    test("echo $")
    test("echo \$")
    test("echo \$\$\$\$")
    test("echo \$$\$$")

    test("echo $\A $\B", exports={"A": "a", "B": "b"})
    test("echo $\A$\B", exports={"A": "a", "B": "b"})


@suite
def suite_escape(test):
    test(r"echo \a")
    test(r"\e\c\h\o bonjour")
    test(r"echo charles\ ")
    test(r"echo \ \ jesuis\ \ charles")
    test(r"echo \ \ jesuis\; \ charles")
    test(r"echo \ \ jesuis\&\& \ charles")
    test(r"echo \ \ jesuis\|\| \ charles")
    test(r"echo \ \ jesuis \|\| \ charles")
    test(r"echo \ \ jesuis\; \ charles")
    test(r"echo \ \ \ \ \ \ \ \ ")
    test(r"echo \ \ \ \ \ \ \ \               \ \ \ \ \ \ ")
    test(r"echo \$PATH")
    test(r"echo \$\P\A\T\H")
    test(r"echo\ bonjour")
    test(r"\ echo bonjour")
    test(r" \ echo bonjour")
    test(r"                 \ echo bonjour")
    test(r" \                 echo bonjour")
    test(r"                 \                    echo bonjour")

# @suite
# def suite_preprocess(test):
#     test(r"echo \*", setup="touch a b c")
#     test(r"echo \*\*", setup="touch a b c")
#     test(r"echo \ *", setup="touch a b c")
#     test(r"echo *\.c", setup="touch a.c b.c c.c")
#     test(r"echo *.\c", setup="touch a.c b.c c.c")
#     test(r"echo *.c\ ", setup="touch a.c b.c c.c")
#     test("echo $A$B",
#             setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.c inc/bar.c",
#             exports={"A": "*", "B": "/*.c"})
#     test("echo $A$B",
#             setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.c inc/bar.c",
#             exports={"A": "*/.", "B": "*.c"})

# @suite
# def suite_glob(test):
#     test("echo *")
#     test("echo *", setup="touch a b c")
#     test("echo *.c", setup="touch a b c foo.c bar.c")
#     test("echo src/*.c", setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c")
#     test("echo */*.c", setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c")
#     test("echo */*.c",
#             setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.c inc/bar.c")
#     test("echo */*.h",
#             setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.h inc/bar.h")
#     test("echo l1/*/l3/*/*",
#             setup="mkdir -p l1/l2_1/l3; mkdir -p l1/l2_2; cd l1/l2_1/l3;\
#                    mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.h inc/bar.h;\
#                    cd ../../..; cd l1/l2_2; touch bonjour je suis")
#
#     test("echo */*/*/*/*.c",
#             setup="mkdir -p l1/l2/l3; cd l1/l2/l3;\
#                    mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.h inc/bar.h")
#     test("echo */*/*/*/*.h",
#             setup="mkdir -p l1/l2/l3; cd l1/l2/l3;\
#                    mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.h inc/bar.h")
#
#     test("echo */*/*/*.c",
#             setup="mkdir -p l1/l2/l3; cd l1/l2/l3;\
#                    mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.h inc/bar.h")
#     test("echo */*/*/*.h",
#             setup="mkdir -p l1/l2/l3; cd l1/l2/l3;\
#                    mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.h inc/bar.h")
#
#     test("echo */*/*/*/*/*.c",
#             setup="mkdir -p l1/l2/l3; cd l1/l2/l3;\
#                    mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.h inc/bar.h")
#     test("echo */*/*/*/*/*.h",
#             setup="mkdir -p l1/l2/l3; cd l1/l2/l3;\
#                    mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.h inc/bar.h")
#
#     test("echo /*")
#     test("echo /etc/*")
#     test("echo /usr/include/*.h")
#     # test("echo /*/*", timeout=10)
#     # test("echo /usr/*/*", timeout=10)
#     test("echo /usr/*")
#     test("echo /dev/*")
#     test("echo /etc/*")
#     test("echo /root/*")
#     test("echo /usr*")
#     test("echo /dev*")
#     test("echo /etc*")
#     test("echo /root*")
#
#     test("echo *nothing")
#     test("echo nothing*")
#     test("echo *nothing*")
#
#     test("echo a*b", setup="touch ab aab aaaaab aaaaaaaab acccccb acb abbbb")
#     test("echo a**b", setup="touch ab aab aaaaab aaaaaaaab acccccb acb abbbb")
#     test("echo a***b", setup="touch ab aab aaaaab aaaaaaaab acccccb acb abbbb")
#     test("echo a****b", setup="touch ab aab aaaaab aaaaaaaab acccccb acb abbbb")
#
#     test("echo **")
#     test("echo **", setup="touch a b c")
#     test("echo **", setup="mkdir d; touch d/a d/b d/c")
#     test("echo */*", setup="mkdir d; touch d/a d/b d/c")
#     test("echo */a", setup="mkdir d; touch d/a d/b d/c")
#     test("echo d/*", setup="mkdir d; touch d/a d/b d/c")
#
#     test("*")
#     test("*", setup="touch a b c")
#     test("*.c", setup="touch a b c foo.c bar.c")
#     test("src/*.c", setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c")
#     test("*/*.c", setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c")
#     test("*/*.c",
#             setup="mkdir src; touch src/a src/b src/c src/foo.c src/bar.c;\
#                    mkdir inc; touch inc/a inc/b inc/c inc/foo.c inc/bar.c")
#
#     test("export A=*; echo $A")
#     test("A=*; echo $A")
#
#     test("echo *", setup="mkdir d1; touch d1/a d1/b d1/c; ln -s d1 d1link")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; ln -s d1 d1link")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; ln -s d1 .d1link")
#     test("echo */*", setup="mkdir .d1; touch .d1/a .d1/b .d1/c; ln -s .d1 d1link")
#     test("echo .*/*", setup="mkdir d1; touch d1/a d1/b d1/c; ln -s d1 .d1link")
#     test("echo .*/*", setup="mkdir .d1; touch .d1/a .d1/b .d1/c; ln -s .d1 d1link")
#
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 000 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 001 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 002 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 003 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 004 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 005 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 006 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 007 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 010 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 020 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 030 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 040 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 050 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 060 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 070 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 100 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 200 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 300 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 400 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 500 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 600 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 700 d1/a")
#
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 755 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 644 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 311 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 111 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 222 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 333 d1/a")
#
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 000 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 001 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 002 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 003 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 004 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 005 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 006 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 007 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 010 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 020 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 030 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 040 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 050 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 060 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 070 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 100 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 200 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 300 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 400 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 500 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 600 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 700 d1")
#
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 755 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 644 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 311 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 111 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 222 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 333 d1")
#
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 0777 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 1000 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 2000 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 3000 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 4000 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 5000 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 6000 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 7000 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 1777 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 2777 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 3777 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 4777 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 5777 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 6777 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 7777 d1/a")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 0000 d1/a")
#
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 0777 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 1000 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 2000 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 3000 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 4000 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 5000 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 6000 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 7000 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 1777 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 2777 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 3777 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 4777 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 5777 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 6777 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 7777 d1")
#     test("echo */*", setup="mkdir d1; touch d1/a d1/b d1/c; chmod 0000 d1")
#
#     test("echo *", setup="touch a; ln -s a b")
#     test("echo *", setup="touch a; ln -s a b; ln -s b c")
#     test("echo *", setup="touch a; ln -s a b; ln -s b c; ln -s c d")
#     test("echo d/*", setup="mkdir d; touch a b c d/d d/e d/f")
#     test("echo d/*", setup="mkdir d; touch a b c d/d d/e d/f; chmod 000 d")