summaryrefslogtreecommitdiffstats
path: root/t/chainlint/while-loop.test
diff options
context:
space:
mode:
Diffstat (limited to 't/chainlint/while-loop.test')
-rw-r--r--t/chainlint/while-loop.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/chainlint/while-loop.test b/t/chainlint/while-loop.test
new file mode 100644
index 0000000..d09fb01
--- /dev/null
+++ b/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
+)