From 22a82341b10299f70903ad7a49fafcf3446a248f Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 21 Oct 2014 16:20:58 +0200 Subject: [PATCH] tests: fix --help test Check for "Usage" only in the root command, builtins may not output it. Signed-off-by: Giuseppe Scrivano --- tests/test-help.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test-help.sh b/tests/test-help.sh index db7f65d7..4c1ffadd 100755 --- a/tests/test-help.sh +++ b/tests/test-help.sh @@ -26,11 +26,15 @@ echo "1..1" echo "Testing:" 1>&2 test_recursive() { local cmd=$1 + local root=$2 + echo "$cmd" 1>&2 $cmd --help 1>out 2>err # --help message goes to standard output - assert_file_has_content out "[Uu]sage" - assert_file_has_content out "$cmd" + if [ "$root" == "1" ] ; then + assert_file_has_content out "[Uu]sage" + assert_file_has_content out "$cmd" + fi assert_file_empty err builtins=`sed -n '/^Builtin commands/,/^[^ ]/p'