about summary refs log tree commit diff
path: root/third_party/git/t/chainlint/for-loop.test
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/t/chainlint/for-loop.test')
-rw-r--r--third_party/git/t/chainlint/for-loop.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/third_party/git/t/chainlint/for-loop.test b/third_party/git/t/chainlint/for-loop.test
new file mode 100644
index 000000000000..7db76262bc2e
--- /dev/null
+++ b/third_party/git/t/chainlint/for-loop.test
@@ -0,0 +1,19 @@
+(
+# LINT: 'for', 'do', 'done' do not need "&&"
+	for i in a b c
+	do
+# LINT: missing "&&" on 'echo'
+		echo $i
+# LINT: last statement of while does not need "&&"
+		cat <<-\EOF
+		bar
+		EOF
+# LINT: missing "&&" on 'done'
+	done
+
+# LINT: 'do' on same line as 'for'
+	for i in a b c; do
+		echo $i &&
+		cat $i
+	done
+)