about summary refs log tree commit diff
path: root/t/chainlint/exit-loop.test
blob: 2f038207e194ca0c51106205b3d57f4c7d1d7881 (plain) (blame)
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
(
	for i in a b c
	do
# LINT: "|| exit {n}" valid for-loop escape in subshell; no "&&" needed
		foo || exit 1
		bar &&
		baz
	done
) &&
(
	while true
	do
# LINT: "|| exit {n}" valid while-loop escape in subshell; no "&&" needed
		foo || exit 1
		bar &&
		baz
	done
) &&
(
	i=0 &&
	while test $i -lt 10
	do
# LINT: "|| exit" (sans exit code) valid escape in subshell; no "&&" needed
		echo $i || exit
		i=$(($i + 1))
	done
)