From 3e82f3ca56aa20c0dc593f613c167e12b331be51 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Sun, 15 Apr 2012 10:33:51 +0200 Subject: [PATCH] Tests: Extract backtick_check(). --- tests/t0100-code-nobacktick.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/t0100-code-nobacktick.sh b/tests/t0100-code-nobacktick.sh index 1b827b3..c11f6bc 100755 --- a/tests/t0100-code-nobacktick.sh +++ b/tests/t0100-code-nobacktick.sh @@ -9,8 +9,13 @@ On failure, it will print each offending line number and line. ' . ./test-lib.sh +backtick_check() +{ + sed -n -e 's/\(^\|[ \t]\)#.*//' -e '/`/{' -e '=;p' -e '}' "$@" +} + test_todo_session 'no old-style backtick command substitution' <>> sed -n -e 's/\(^\|[ \t]\)#.*//' -e '/\`/{' -e '=;p' -e '}' "$(which todo.sh)" +>>> backtick_check "$(which todo.sh)" EOF test_done