Skip to content

Commit 3a00b7d

Browse files
committed
sharness/t0010: check that all the commands fail when passed a bad flag
License: MIT Signed-off-by: Christian Couder <[email protected]>
1 parent 11ce044 commit 3a00b7d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/sharness/t0010-basic-commands.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ test_expect_failure "All ipfs commands docs are 80 columns or less" '
102102
fi
103103
'
104104

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+
105118
test_expect_success "'ipfs commands --flags' succeeds" '
106119
ipfs commands --flags >commands.txt
107120
'

0 commit comments

Comments
 (0)