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