@cryptotaxi247 / kubo / commits / 548902521

test: add test for checking if commands mans lengths are shorter than 80

License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

Jakub Sztandera committed Mar 10, 2017 at 18:49 UTC 5489025210c7bcb3787876ab20799276e8fafee6
1 file changed +14
test/sharness/t0010-basic-commands.sh
+14
@@ -88,6 +88,20 @@ test_expect_failure "All ipfs root commands are mentioned in base helptext" '
88 fi
89 '
90
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 +
105 test_expect_success "'ipfs commands --flags' succeeds" '
106 ipfs commands --flags >commands.txt
107 '