test: Improve colon test comment

I use these patterns when early hacking, and it's good to have a test to
catch them all before I merge.
This commit is contained in:
James Shubin
2025-09-08 23:05:07 -04:00
parent 6fac46da7c
commit 2e858ff447
2 changed files with 3 additions and 2 deletions

View File

@@ -1688,7 +1688,7 @@ func TestResources2(t *testing.T) {
fileAbsent(d2f1), fileAbsent(d2f1),
fileAbsent(d2f2), fileAbsent(d2f2),
fileAbsent(d2f3), fileAbsent(d2f3),
fileExists(p2, false), // ensure it's a file XXX !!! fileExists(p2, false), // ensure it's a file
fileExists(p3, true), // ensure it's a dir fileExists(p3, true), // ensure it's a dir
fileExists(p4, false), fileExists(p4, false),
resCheckApply(r1, true), // it's already good resCheckApply(r1, true), // it's already good

View File

@@ -34,7 +34,8 @@ function simplify-gocase() {
function token-coloncheck() { function token-coloncheck() {
# add quotes to avoid matching three X's # add quotes to avoid matching three X's
if grep -Ei "[\/]+[\/]+[ ]*(T"'O''D'"O[^:]|F"'I''X''M'"E[^:]|X"'X'"X[^:])" "$1"; then #if grep -Ei "[\/]+[\/]+[ ]*(T"'O''D'"O[^:]|F"'I''X''M'"E[^:]|X"'X'"X[^:])" "$1"; then
if grep -Ei "[\/]+[\/]+[\ 0-9a-zA-Z_@\*\?\'\(\)\{\}-]*(T"'O''D'"O[^:]|F"'I''X''M'"E[^:]|X"'X'"X[^:])" "$1"; then # not perfect
return 1 # tokens must end with a colon return 1 # tokens must end with a colon
fi fi
# tokens must be upper case # tokens must be upper case