Skip to content

Commit 8425b7e

Browse files
pranitbauva1997gitster
authored andcommitted
t0040-test-parse-options.sh: fix style issues
Signed-off-by: Pranit Bauva <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7b0d47b commit 8425b7e

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

t/t0040-parse-options.sh

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test_description='our own option parser'
77

88
. ./test-lib.sh
99

10-
cat > expect << EOF
10+
cat >expect <<\EOF
1111
usage: test-parse-options <options>
1212
1313
--yes get a boolean
@@ -49,14 +49,14 @@ Standard options
4949
EOF
5050

5151
test_expect_success 'test help' '
52-
test_must_fail test-parse-options -h > output 2> output.err &&
52+
test_must_fail test-parse-options -h >output 2>output.err &&
5353
test_must_be_empty output.err &&
5454
test_i18ncmp expect output
5555
'
5656

5757
mv expect expect.err
5858

59-
cat >expect.template <<EOF
59+
cat >expect.template <<\EOF
6060
boolean: 0
6161
integer: 0
6262
magnitude: 0
@@ -156,7 +156,7 @@ test_expect_success 'OPT_MAGNITUDE() 3giga' '
156156
check magnitude: 3221225472 -m 3g
157157
'
158158

159-
cat > expect << EOF
159+
cat >expect <<\EOF
160160
boolean: 2
161161
integer: 1729
162162
magnitude: 16384
@@ -176,7 +176,7 @@ test_expect_success 'short options' '
176176
test_must_be_empty output.err
177177
'
178178

179-
cat > expect << EOF
179+
cat >expect <<\EOF
180180
boolean: 2
181181
integer: 1729
182182
magnitude: 16384
@@ -204,7 +204,7 @@ test_expect_success 'missing required value' '
204204
test_expect_code 129 test-parse-options --file
205205
'
206206

207-
cat > expect << EOF
207+
cat >expect <<\EOF
208208
boolean: 1
209209
integer: 13
210210
magnitude: 0
@@ -222,12 +222,12 @@ EOF
222222

223223
test_expect_success 'intermingled arguments' '
224224
test-parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \
225-
> output 2> output.err &&
225+
>output 2>output.err &&
226226
test_must_be_empty output.err &&
227227
test_cmp expect output
228228
'
229229

230-
cat > expect << EOF
230+
cat >expect <<\EOF
231231
boolean: 0
232232
integer: 2
233233
magnitude: 0
@@ -241,13 +241,13 @@ file: (not set)
241241
EOF
242242

243243
test_expect_success 'unambiguously abbreviated option' '
244-
test-parse-options --int 2 --boolean --no-bo > output 2> output.err &&
244+
test-parse-options --int 2 --boolean --no-bo >output 2>output.err &&
245245
test_must_be_empty output.err &&
246246
test_cmp expect output
247247
'
248248

249249
test_expect_success 'unambiguously abbreviated option with "="' '
250-
test-parse-options --int=2 > output 2> output.err &&
250+
test-parse-options --int=2 >output 2>output.err &&
251251
test_must_be_empty output.err &&
252252
test_cmp expect output
253253
'
@@ -256,7 +256,7 @@ test_expect_success 'ambiguously abbreviated option' '
256256
test_expect_code 129 test-parse-options --strin 123
257257
'
258258

259-
cat > expect << EOF
259+
cat >expect <<\EOF
260260
boolean: 0
261261
integer: 0
262262
magnitude: 0
@@ -270,32 +270,32 @@ file: (not set)
270270
EOF
271271

272272
test_expect_success 'non ambiguous option (after two options it abbreviates)' '
273-
test-parse-options --st 123 > output 2> output.err &&
273+
test-parse-options --st 123 >output 2>output.err &&
274274
test_must_be_empty output.err &&
275275
test_cmp expect output
276276
'
277277

278-
cat > typo.err << EOF
279-
error: did you mean \`--boolean\` (with two dashes ?)
278+
cat >typo.err <<\EOF
279+
error: did you mean `--boolean` (with two dashes ?)
280280
EOF
281281

282282
test_expect_success 'detect possible typos' '
283-
test_must_fail test-parse-options -boolean > output 2> output.err &&
283+
test_must_fail test-parse-options -boolean >output 2>output.err &&
284284
test_must_be_empty output &&
285285
test_cmp typo.err output.err
286286
'
287287

288-
cat > typo.err << EOF
289-
error: did you mean \`--ambiguous\` (with two dashes ?)
288+
cat >typo.err <<\EOF
289+
error: did you mean `--ambiguous` (with two dashes ?)
290290
EOF
291291

292292
test_expect_success 'detect possible typos' '
293-
test_must_fail test-parse-options -ambiguous > output 2> output.err &&
293+
test_must_fail test-parse-options -ambiguous >output 2>output.err &&
294294
test_must_be_empty output &&
295295
test_cmp typo.err output.err
296296
'
297297

298-
cat > expect <<EOF
298+
cat >expect <<\EOF
299299
boolean: 0
300300
integer: 0
301301
magnitude: 0
@@ -310,12 +310,12 @@ arg 00: --quux
310310
EOF
311311

312312
test_expect_success 'keep some options as arguments' '
313-
test-parse-options --quux > output 2> output.err &&
313+
test-parse-options --quux >output 2>output.err &&
314314
test_must_be_empty output.err &&
315-
test_cmp expect output
315+
test_cmp expect output
316316
'
317317

318-
cat > expect <<EOF
318+
cat >expect <<\EOF
319319
boolean: 0
320320
integer: 0
321321
magnitude: 0
@@ -331,12 +331,12 @@ EOF
331331

332332
test_expect_success 'OPT_DATE() works' '
333333
test-parse-options -t "1970-01-01 00:00:01 +0000" \
334-
foo -q > output 2> output.err &&
334+
foo -q >output 2>output.err &&
335335
test_must_be_empty output.err &&
336336
test_cmp expect output
337337
'
338338

339-
cat > expect <<EOF
339+
cat >expect <<\EOF
340340
Callback: "four", 0
341341
boolean: 5
342342
integer: 4
@@ -351,22 +351,22 @@ file: (not set)
351351
EOF
352352

353353
test_expect_success 'OPT_CALLBACK() and OPT_BIT() work' '
354-
test-parse-options --length=four -b -4 > output 2> output.err &&
354+
test-parse-options --length=four -b -4 >output 2>output.err &&
355355
test_must_be_empty output.err &&
356356
test_cmp expect output
357357
'
358358

359-
cat > expect <<EOF
359+
cat >expect <<\EOF
360360
Callback: "not set", 1
361361
EOF
362362

363363
test_expect_success 'OPT_CALLBACK() and callback errors work' '
364-
test_must_fail test-parse-options --no-length > output 2> output.err &&
364+
test_must_fail test-parse-options --no-length >output 2>output.err &&
365365
test_i18ncmp expect output &&
366366
test_i18ncmp expect.err output.err
367367
'
368368

369-
cat > expect <<EOF
369+
cat >expect <<\EOF
370370
boolean: 1
371371
integer: 23
372372
magnitude: 0
@@ -380,18 +380,18 @@ file: (not set)
380380
EOF
381381

382382
test_expect_success 'OPT_BIT() and OPT_SET_INT() work' '
383-
test-parse-options --set23 -bbbbb --no-or4 > output 2> output.err &&
383+
test-parse-options --set23 -bbbbb --no-or4 >output 2>output.err &&
384384
test_must_be_empty output.err &&
385385
test_cmp expect output
386386
'
387387

388388
test_expect_success 'OPT_NEGBIT() and OPT_SET_INT() work' '
389-
test-parse-options --set23 -bbbbb --neg-or4 > output 2> output.err &&
389+
test-parse-options --set23 -bbbbb --neg-or4 >output 2>output.err &&
390390
test_must_be_empty output.err &&
391391
test_cmp expect output
392392
'
393393

394-
cat > expect <<EOF
394+
cat >expect <<\EOF
395395
boolean: 6
396396
integer: 0
397397
magnitude: 0
@@ -405,24 +405,24 @@ file: (not set)
405405
EOF
406406

407407
test_expect_success 'OPT_BIT() works' '
408-
test-parse-options -bb --or4 > output 2> output.err &&
408+
test-parse-options -bb --or4 >output 2>output.err &&
409409
test_must_be_empty output.err &&
410410
test_cmp expect output
411411
'
412412

413413
test_expect_success 'OPT_NEGBIT() works' '
414-
test-parse-options -bb --no-neg-or4 > output 2> output.err &&
414+
test-parse-options -bb --no-neg-or4 >output 2>output.err &&
415415
test_must_be_empty output.err &&
416416
test_cmp expect output
417417
'
418418

419419
test_expect_success 'OPT_COUNTUP() with PARSE_OPT_NODASH works' '
420-
test-parse-options + + + + + + > output 2> output.err &&
420+
test-parse-options + + + + + + >output 2>output.err &&
421421
test_must_be_empty output.err &&
422422
test_cmp expect output
423423
'
424424

425-
cat > expect <<EOF
425+
cat >expect <<\EOF
426426
boolean: 0
427427
integer: 12345
428428
magnitude: 0
@@ -436,12 +436,12 @@ file: (not set)
436436
EOF
437437

438438
test_expect_success 'OPT_NUMBER_CALLBACK() works' '
439-
test-parse-options -12345 > output 2> output.err &&
439+
test-parse-options -12345 >output 2>output.err &&
440440
test_must_be_empty output.err &&
441441
test_cmp expect output
442442
'
443443

444-
cat >expect <<EOF
444+
cat >expect <<\EOF
445445
boolean: 0
446446
integer: 0
447447
magnitude: 0
@@ -460,7 +460,7 @@ test_expect_success 'negation of OPT_NONEG flags is not ambiguous' '
460460
test_cmp expect output
461461
'
462462

463-
cat >>expect <<'EOF'
463+
cat >>expect <<\EOF
464464
list: foo
465465
list: bar
466466
list: baz

0 commit comments

Comments
 (0)