summaryrefslogtreecommitdiff
path: root/t/chainlint/loop-detect-failure.test
diff options
context:
space:
mode:
Diffstat (limited to 't/chainlint/loop-detect-failure.test')
-rw-r--r--t/chainlint/loop-detect-failure.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/chainlint/loop-detect-failure.test b/t/chainlint/loop-detect-failure.test
new file mode 100644
index 0000000000..44673aa394
--- /dev/null
+++ b/t/chainlint/loop-detect-failure.test
@@ -0,0 +1,19 @@
+test_expect_success 'loop-detect-failure' '
+git init r1 &&
+# LINT: loop handles failure explicitly with "|| return 1"
+for n in 1 2 3 4 5
+do
+ echo "This is file: $n" > r1/file.$n &&
+ git -C r1 add file.$n &&
+ git -C r1 commit -m "$n" || return 1
+done &&
+
+git init r2 &&
+# LINT: loop fails to handle failure explicitly with "|| return 1"
+for n in 1000 10000
+do
+ printf "%"$n"s" X > r2/large.$n &&
+ git -C r2 add large.$n &&
+ git -C r2 commit -m "$n"
+done
+'