sharness/t0010: check that all the commands fail when passed a bad flag
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Mar 20, 2018 at 21:07 UTC
3a00b7dca1d20812fa28b0cf80d927768f858650
1 file changed
+13
test/sharness/t0010-basic-commands.sh
+13
@@ -102,6 +102,19 @@ test_expect_failure "All ipfs commands docs are 80 columns or less" '
102
fi
103
'
104
105
+test_expect_success "All ipfs commands fail when passed a bad flag" '
106
+ echo 0 > fail
107
+ while read -r cmd
108
+ do
109
+ test_must_fail $cmd --badflag >/dev/null ||
110
+ { echo $cmd exit with code 0 when passed --badflag; echo 1 > fail; }
111
+ done <commands.txt
112
+
113
+ if [ $(cat fail) = 1 ]; then
114
+ return 1
115
+ fi
116
+'
117
+
118
test_expect_success "'ipfs commands --flags' succeeds" '
119
ipfs commands --flags >commands.txt
120
'