summaryrefslogtreecommitdiff
path: root/t/chainlint/semicolon.test
diff options
context:
space:
mode:
authorLibravatar Eric Sunshine <sunshine@sunshineco.com>2021-12-13 01:30:47 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-12-13 14:15:28 -0800
commit1ad0780a779bbc4cc6dbda86ef20f69071d25235 (patch)
tree538344e0809c22a065ceb4f0df6832975a53a3c1 /t/chainlint/semicolon.test
parentt/chainlint/*.test: fix invalid test cases due to mixing quote types (diff)
downloadtgif-1ad0780a779bbc4cc6dbda86ef20f69071d25235.tar.xz
t/chainlint/*.test: generalize self-test commentary
The purpose of chainlint.sed is to detect &&-chain breakage only within subshells (one level deep); it doesn't bother checking for top-level &&-chain breakage since the &&-chain checker built into t/test-lib.sh should detect broken &&-chains outside of subshells by making them magically exit with code 117. However, this division of labor may not always be the case if a more capable chainlint implementation is ever developed. Beyond that, due to being sed-based and due to its use of heuristics, chainlint.sed has several limitations (such as being unable to detect &&-chain breakage in subshells more than one level deep since it only manually emulates recursion into a subshell). Some of the comments in the chainlint self-tests unnecessarily reflect the limitations of chainlint.sed even though those limitations are not what is being tested. Therefore, simplify and generalize the comments to explain only what is being tested, thus ensuring that they won't become outdated if a more capable chainlint is ever developed. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/chainlint/semicolon.test')
-rw-r--r--t/chainlint/semicolon.test4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/chainlint/semicolon.test b/t/chainlint/semicolon.test
index d82c8ebbc0..67e1192c50 100644
--- a/t/chainlint/semicolon.test
+++ b/t/chainlint/semicolon.test
@@ -15,11 +15,11 @@
cat foo; echo bar
) &&
(
-# LINT: unnecessary terminating semicolon
+# LINT: semicolon unnecessary but legitimate
foo;
) &&
(cd foo &&
for i in a b c; do
-# LINT: unnecessary terminating semicolon
+# LINT: semicolon unnecessary but legitimate
echo;
done)