| 1 | test_expect_success 'exit-loop' ' |
| 2 | ( |
| 3 | for i in a b c |
| 4 | do |
| 5 | # LINT: "|| exit {n}" valid for-loop escape in subshell; no "&&" needed |
| 6 | foo || exit 1 |
| 7 | bar && |
| 8 | baz |
| 9 | done |
| 10 | ) && |
| 11 | ( |
| 12 | while true |
| 13 | do |
| 14 | # LINT: "|| exit {n}" valid while-loop escape in subshell; no "&&" needed |
| 15 | foo || exit 1 |
| 16 | bar && |
| 17 | baz |
| 18 | done |
| 19 | ) && |
| 20 | ( |
| 21 | i=0 && |
| 22 | while test $i -lt 10 |
| 23 | do |
| 24 | # LINT: "|| exit" (sans exit code) valid escape in subshell; no "&&" needed |
| 25 | echo $i || exit |
| 26 | i=$(($i + 1)) |
| 27 | done |
| 28 | ) |
| 29 | ' |