From 72fe73f3d8b2ec51e04e86211f5365cb0d551d20 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Mon, 11 Jul 2011 21:34:41 +0200 Subject: [PATCH] nobacktick test: Use literal backtick * Fix sed error on Mac OS, also ignore entire commented lines. * With proper quoting, the non-POSIX \d96 escape isn't necessary, and the check should work also on Mac OS. --- tests/t0100-code-nobacktick.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/t0100-code-nobacktick.sh b/tests/t0100-code-nobacktick.sh index 6db16d6..023c2a9 100755 --- a/tests/t0100-code-nobacktick.sh +++ b/tests/t0100-code-nobacktick.sh @@ -5,11 +5,12 @@ 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 '/\`/{' -e '=;p' -e '}' "$(which todo.sh)" EOF test_done