]> git.ipfire.org Git - thirdparty/git.git/blob - t/chainlint/nested-loop-detect-failure.test
Merge branch 'jk/clone-allow-bare-and-o-together'
[thirdparty/git.git] / t / chainlint / nested-loop-detect-failure.test
1 # LINT: neither loop handles failure explicitly with "|| return 1"
2 for i in 0 1 2 3 4 5 6 7 8 9;
3 do
4 for j in 0 1 2 3 4 5 6 7 8 9;
5 do
6 echo "$i$j" >"path$i$j"
7 done
8 done &&
9
10 # LINT: inner loop handles failure explicitly with "|| return 1"
11 for i in 0 1 2 3 4 5 6 7 8 9;
12 do
13 for j in 0 1 2 3 4 5 6 7 8 9;
14 do
15 echo "$i$j" >"path$i$j" || return 1
16 done
17 done &&
18
19 # LINT: outer loop handles failure explicitly with "|| return 1"
20 for i in 0 1 2 3 4 5 6 7 8 9;
21 do
22 for j in 0 1 2 3 4 5 6 7 8 9;
23 do
24 echo "$i$j" >"path$i$j"
25 done || return 1
26 done &&
27
28 # LINT: inner & outer loops handles failure explicitly with "|| return 1"
29 for i in 0 1 2 3 4 5 6 7 8 9;
30 do
31 for j in 0 1 2 3 4 5 6 7 8 9;
32 do
33 echo "$i$j" >"path$i$j" || return 1
34 done || return 1
35 done