t0040-test-parse-options.sh: fix style issues

Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pranit Bauva committed Apr 12, 2016 at 23:02 UTC 8425b7ea6a00c443ca3649545ac6e9ddfa196ef6
1 file changed +38 -38
t/t0040-parse-options.sh
+38 -38
@@ -7,7 +7,7 @@ test_description='our own option parser'
7
8 . ./test-lib.sh
9
10 -cat > expect << EOF
10 +cat >expect <<\EOF
11 usage: test-parse-options <options>
12
13 --yes get a boolean
@@ -49,14 +49,14 @@ Standard options
49 EOF
50
51 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 &&
53 test_must_be_empty output.err &&
54 test_i18ncmp expect output
55 '
56
57 mv expect expect.err
58
59 -cat >expect.template <<EOF
59 +cat >expect.template <<\EOF
60 boolean: 0
61 integer: 0
62 magnitude: 0
@@ -156,7 +156,7 @@ test_expect_success 'OPT_MAGNITUDE() 3giga' '
156 check magnitude: 3221225472 -m 3g
157 '
158
159 -cat > expect << EOF
159 +cat >expect <<\EOF
160 boolean: 2
161 integer: 1729
162 magnitude: 16384
@@ -176,7 +176,7 @@ test_expect_success 'short options' '
176 test_must_be_empty output.err
177 '
178
179 -cat > expect << EOF
179 +cat >expect <<\EOF
180 boolean: 2
181 integer: 1729
182 magnitude: 16384
@@ -204,7 +204,7 @@ test_expect_success 'missing required value' '
204 test_expect_code 129 test-parse-options --file
205 '
206
207 -cat > expect << EOF
207 +cat >expect <<\EOF
208 boolean: 1
209 integer: 13
210 magnitude: 0
@@ -222,12 +222,12 @@ EOF
222
223 test_expect_success 'intermingled arguments' '
224 test-parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \
225 - > output 2> output.err &&
225 + >output 2>output.err &&
226 test_must_be_empty output.err &&
227 test_cmp expect output
228 '
229
230 -cat > expect << EOF
230 +cat >expect <<\EOF
231 boolean: 0
232 integer: 2
233 magnitude: 0
@@ -241,13 +241,13 @@ file: (not set)
241 EOF
242
243 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 &&
245 test_must_be_empty output.err &&
246 test_cmp expect output
247 '
248
249 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 &&
251 test_must_be_empty output.err &&
252 test_cmp expect output
253 '
@@ -256,7 +256,7 @@ test_expect_success 'ambiguously abbreviated option' '
256 test_expect_code 129 test-parse-options --strin 123
257 '
258
259 -cat > expect << EOF
259 +cat >expect <<\EOF
260 boolean: 0
261 integer: 0
262 magnitude: 0
@@ -270,32 +270,32 @@ file: (not set)
270 EOF
271
272 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 &&
274 test_must_be_empty output.err &&
275 test_cmp expect output
276 '
277
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 ?)
280 EOF
281
282 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 &&
284 test_must_be_empty output &&
285 test_cmp typo.err output.err
286 '
287
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 ?)
290 EOF
291
292 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 &&
294 test_must_be_empty output &&
295 test_cmp typo.err output.err
296 '
297
298 -cat > expect <<EOF
298 +cat >expect <<\EOF
299 boolean: 0
300 integer: 0
301 magnitude: 0
@@ -310,12 +310,12 @@ arg 00: --quux
310 EOF
311
312 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 &&
314 test_must_be_empty output.err &&
315 - test_cmp expect output
315 + test_cmp expect output
316 '
317
318 -cat > expect <<EOF
318 +cat >expect <<\EOF
319 boolean: 0
320 integer: 0
321 magnitude: 0
@@ -331,12 +331,12 @@ EOF
331
332 test_expect_success 'OPT_DATE() works' '
333 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 &&
335 test_must_be_empty output.err &&
336 test_cmp expect output
337 '
338
339 -cat > expect <<EOF
339 +cat >expect <<\EOF
340 Callback: "four", 0
341 boolean: 5
342 integer: 4
@@ -351,22 +351,22 @@ file: (not set)
351 EOF
352
353 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 &&
355 test_must_be_empty output.err &&
356 test_cmp expect output
357 '
358
359 -cat > expect <<EOF
359 +cat >expect <<\EOF
360 Callback: "not set", 1
361 EOF
362
363 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 &&
365 test_i18ncmp expect output &&
366 test_i18ncmp expect.err output.err
367 '
368
369 -cat > expect <<EOF
369 +cat >expect <<\EOF
370 boolean: 1
371 integer: 23
372 magnitude: 0
@@ -380,18 +380,18 @@ file: (not set)
380 EOF
381
382 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 &&
384 test_must_be_empty output.err &&
385 test_cmp expect output
386 '
387
388 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 &&
390 test_must_be_empty output.err &&
391 test_cmp expect output
392 '
393
394 -cat > expect <<EOF
394 +cat >expect <<\EOF
395 boolean: 6
396 integer: 0
397 magnitude: 0
@@ -405,24 +405,24 @@ file: (not set)
405 EOF
406
407 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 &&
409 test_must_be_empty output.err &&
410 test_cmp expect output
411 '
412
413 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 &&
415 test_must_be_empty output.err &&
416 test_cmp expect output
417 '
418
419 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 &&
421 test_must_be_empty output.err &&
422 test_cmp expect output
423 '
424
425 -cat > expect <<EOF
425 +cat >expect <<\EOF
426 boolean: 0
427 integer: 12345
428 magnitude: 0
@@ -436,12 +436,12 @@ file: (not set)
436 EOF
437
438 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 &&
440 test_must_be_empty output.err &&
441 test_cmp expect output
442 '
443
444 -cat >expect <<EOF
444 +cat >expect <<\EOF
445 boolean: 0
446 integer: 0
447 magnitude: 0
@@ -460,7 +460,7 @@ test_expect_success 'negation of OPT_NONEG flags is not ambiguous' '
460 test_cmp expect output
461 '
462
463 -cat >>expect <<'EOF'
463 +cat >>expect <<\EOF
464 list: foo
465 list: bar
466 list: baz