From faf86c88cb28112638d484d612d7afa9c144d1fe Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Sun, 10 Jul 2011 14:31:20 +0200 Subject: [PATCH] nobacktick code check: Skip entire comment lines, too. --- tests/t0100-code-nobacktick.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/t0100-code-nobacktick.sh b/tests/t0100-code-nobacktick.sh index 6db16d6..22ae475 100755 --- a/tests/t0100-code-nobacktick.sh +++ b/tests/t0100-code-nobacktick.sh @@ -5,11 +5,13 @@ test_description='no old-style backtick command substitution This test checks the todo.sh script itself for occurrences of old-style backtick command substitution, which should be replaced with $(...). +On failure, it will print each offending line number and line. ' . ./test-lib.sh test_todo_session 'no old-style backtick command substitution' <>> sed -n -e 's/[ \t]#.*//' -e '/\d96/{=;p}' "$(which todo.sh)" +>>> sed -n -e 's/\(^\|[ \t]\)#.*//' -e '/\d96/{=;p}' "$(which todo.sh)" EOF +# Note: Must encode backtick as \d96 to avoid error in the test framework. test_done