Skip to content

Commit

Permalink
test: add test for checking if commands mans lengths are shorter than 80
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Mar 10, 2017
1 parent 2317ced commit 5489025
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/sharness/t0010-basic-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
if [ $(cat fail) = 1 ]; then
return 1
fi
'

test_expect_success "'ipfs commands --flags' succeeds" '
ipfs commands --flags >commands.txt
'
Expand Down

0 comments on commit 5489025

Please sign in to comment.