@cryptotaxi247 / kubo / commits / 454085c81

test: small cleanup of t0010

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

Jakub Sztandera committed Mar 6, 2017 at 20:24 UTC 454085c810c95a11085ae65bae887a6e26c81785
1 file changed +22 -4
test/sharness/t0010-basic-commands.sh
+22 -4
@@ -17,8 +17,7 @@ test_expect_success "ipfs version succeeds" '
17 '
18
19 test_expect_success "ipfs --version success" '
20 - ipfs --version ||
21 - test_fsh ipfs --version
20 + ipfs --version
21 '
22
23 test_expect_success "ipfs version output looks good" '
@@ -65,9 +64,26 @@ test_expect_success "'ipfs commands' output looks good" '
64 test_expect_success "All commands accept --help" '
65 while read -r cmd
66 do
68 - echo "running: $cmd --help"
69 - $cmd --help </dev/null >/dev/null || return
67 + $cmd --help </dev/null >/dev/null ||
68 + { echo $cmd doesnt accept --help; FAIL=1; }
69 done <commands.txt
70 +
71 + if [ ${FAIL-0} = 1 ]; then
72 + return 1
73 + fi
74 +'
75 +
76 +test_expect_failure "All ipfs root commands are mentioned in base helptext" '
77 + cut -d" " -f 2 commands.txt | sort -u | \
78 + while read cmd
79 + do
80 + grep " $cmd" help.txt > /dev/null ||
81 + { echo missing $cmd from helptext; FAIL=1; }
82 + done
83 +
84 + if [ ${FAIL-0} = 1 ]; then
85 + return 1
86 + fi
87 '
88
89 test_expect_success "'ipfs commands --flags' succeeds" '
@@ -80,4 +96,6 @@ test_expect_success "'ipfs commands --flags' output looks good" '
96 grep "ipfs repo gc --quiet / ipfs repo gc -q" commands.txt
97 '
98
99 +
100 +
101 test_done