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

Commit 7cf60bb

Browse files
chriscooldaviddias
authored andcommitted
sharness: t0010- jsipfs version (#518)
* t0010: add failing tests * sharness
1 parent 1c12f46 commit 7cf60bb

File tree

1 file changed

+46
-3
lines changed

1 file changed

+46
-3
lines changed

test/sharness/t0010-basic-commands.sh

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ test_description="Test installation and some basic commands"
99
. lib/test-lib.sh
1010

1111
test_expect_success "current dir is writable" '
12-
echo "It works!" >test.txt
12+
echo "It works!" > test.txt
1313
'
1414

1515
test_expect_success "ipfs version succeeds" '
16-
ipfs version >version.txt
16+
ipfs version > version.txt
1717
'
1818

1919
test_expect_success "ipfs version shows js-ipfs" '
20-
grep "js-ipfs" version.txt >/dev/null ||
20+
grep "js-ipfs" version.txt > /dev/null ||
2121
test_fsh cat version.txt
2222
'
2323

@@ -26,4 +26,47 @@ 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 "js-ipfs version" version_all.txt
32+
'
33+
34+
test_expect_success "ipfs help succeeds" '
35+
ipfs help > help.txt
36+
'
37+
38+
# test_expect_success "ipfs help output looks good" '
39+
# egrep -i "^Usage" help.txt > /dev/null &&
40+
# egrep "ipfs .* <command>" help.txt >/dev/null ||
41+
# test_fsh cat help.txt
42+
# '
43+
44+
test_expect_success "'ipfs commands' succeeds" '
45+
ipfs commands > commands.txt
46+
'
47+
48+
test_expect_success "'ipfs commands' output looks good" '
49+
grep "add" commands.txt &&
50+
grep "daemon" commands.txt &&
51+
grep "update" commands.txt
52+
'
53+
54+
# test_expect_success "All commands accept --help" '
55+
# while read -r cmd
56+
# do
57+
# echo "running: $cmd --help"
58+
# $cmd --help </dev/null >/dev/null || return
59+
# done <commands.txt
60+
# '
61+
62+
# test_expect_success "'ipfs commands --flags' succeeds" '
63+
# ipfs commands --flags >commands.txt
64+
# '
65+
66+
# test_expect_success "'ipfs commands --flags' output looks good" '
67+
# grep "ipfs pin add --recursive / ipfs pin add -r" commands.txt &&
68+
# grep "ipfs id --format / ipfs id -f" commands.txt &&
69+
# grep "ipfs repo gc --quiet / ipfs repo gc -q" commands.txt
70+
# '
71+
2972
test_done

0 commit comments

Comments
 (0)