Skip to content

Commit 5489025

Browse files
committed
test: add test for checking if commands mans lengths are shorter than 80
License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
1 parent 2317ced commit 5489025

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/sharness/t0010-basic-commands.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@ test_expect_failure "All ipfs root commands are mentioned in base helptext" '
8888
fi
8989
'
9090

91+
test_expect_failure "All ipfs commands docs are 80 columns or less" '
92+
echo 0 > fail
93+
while read cmd
94+
do
95+
LENGTH="$($cmd --help | awk "{ print length }" | sort -nr | head -1)"
96+
[ $LENGTH -gt 80 ] &&
97+
{ echo "$cmd" help text is longer than 79 chars "($LENGTH)"; echo 1 > fail; }
98+
done <commands.txt
99+
100+
if [ $(cat fail) = 1 ]; then
101+
return 1
102+
fi
103+
'
104+
91105
test_expect_success "'ipfs commands --flags' succeeds" '
92106
ipfs commands --flags >commands.txt
93107
'

0 commit comments

Comments
 (0)