Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 7bf4e8e

Browse files
committed
t0010: add failing tests
1 parent 7515aec commit 7bf4e8e

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

test/sharness/t0010-basic-commands.sh

+46
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,50 @@ test_expect_success "ipfs version output looks good" '
2626
test_fsh cat version.txt
2727
'
2828

29+
test_expect_success "ipfs version --all has all required fields" '
30+
ipfs version --all > version_all.txt &&
31+
grep "go-ipfs version" version_all.txt &&
32+
grep "Repo version" version_all.txt &&
33+
grep "System version" version_all.txt &&
34+
grep "Golang version" version_all.txt
35+
'
36+
37+
test_expect_success "ipfs help succeeds" '
38+
ipfs help >help.txt
39+
'
40+
41+
test_expect_success "ipfs help output looks good" '
42+
egrep -i "^Usage" help.txt >/dev/null &&
43+
egrep "ipfs .* <command>" help.txt >/dev/null ||
44+
test_fsh cat help.txt
45+
'
46+
47+
test_expect_success "'ipfs commands' succeeds" '
48+
ipfs commands >commands.txt
49+
'
50+
51+
test_expect_success "'ipfs commands' output looks good" '
52+
grep "ipfs add" commands.txt &&
53+
grep "ipfs daemon" commands.txt &&
54+
grep "ipfs update" commands.txt
55+
'
56+
57+
test_expect_success "All commands accept --help" '
58+
while read -r cmd
59+
do
60+
echo "running: $cmd --help"
61+
$cmd --help </dev/null >/dev/null || return
62+
done <commands.txt
63+
'
64+
65+
test_expect_success "'ipfs commands --flags' succeeds" '
66+
ipfs commands --flags >commands.txt
67+
'
68+
69+
test_expect_success "'ipfs commands --flags' output looks good" '
70+
grep "ipfs pin add --recursive / ipfs pin add -r" commands.txt &&
71+
grep "ipfs id --format / ipfs id -f" commands.txt &&
72+
grep "ipfs repo gc --quiet / ipfs repo gc -q" commands.txt
73+
'
74+
2975
test_done

0 commit comments

Comments
 (0)