From 2317ced4aa2ecb003424fd3df4955e936df8ead2 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 10 Mar 2017 18:35:45 +0100 Subject: [PATCH 1/2] test: fix commands tests License: MIT Signed-off-by: Jakub Sztandera --- test/sharness/t0010-basic-commands.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/sharness/t0010-basic-commands.sh b/test/sharness/t0010-basic-commands.sh index 3966d2c0d7d..d59f113daa4 100755 --- a/test/sharness/t0010-basic-commands.sh +++ b/test/sharness/t0010-basic-commands.sh @@ -62,26 +62,28 @@ test_expect_success "'ipfs commands' output looks good" ' ' test_expect_success "All commands accept --help" ' + echo 0 > fail while read -r cmd do $cmd --help /dev/null || - { echo $cmd doesnt accept --help; FAIL=1; } + { echo $cmd doesnt accept --help; echo 1 > fail; } done fail + cut -d" " -f 2 commands.txt | grep -v ipfs | sort -u | \ while read cmd do grep " $cmd" help.txt > /dev/null || - { echo missing $cmd from helptext; FAIL=1; } + { echo missing $cmd from helptext; echo 1 > fail; } done - if [ ${FAIL-0} = 1 ]; then + if [ $(cat fail) = 1 ]; then return 1 fi ' From 5489025210c7bcb3787876ab20799276e8fafee6 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 10 Mar 2017 18:49:06 +0100 Subject: [PATCH 2/2] test: add test for checking if commands mans lengths are shorter than 80 License: MIT Signed-off-by: Jakub Sztandera --- test/sharness/t0010-basic-commands.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/sharness/t0010-basic-commands.sh b/test/sharness/t0010-basic-commands.sh index d59f113daa4..36832013a05 100755 --- a/test/sharness/t0010-basic-commands.sh +++ b/test/sharness/t0010-basic-commands.sh @@ -88,6 +88,20 @@ test_expect_failure "All ipfs root commands are mentioned in base helptext" ' fi ' +test_expect_failure "All ipfs commands docs are 80 columns or less" ' + echo 0 > fail + while read cmd + do + LENGTH="$($cmd --help | awk "{ print length }" | sort -nr | head -1)" + [ $LENGTH -gt 80 ] && + { echo "$cmd" help text is longer than 79 chars "($LENGTH)"; echo 1 > fail; } + done commands.txt '