Skip to content

Commit 3e76cb8

Browse files
committed
sharness: add t0010-multihash-basics.sh
1 parent e425290 commit 3e76cb8

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
3+
test_description="Test multihash basics"
4+
5+
. ./lib/sharness/sharness.sh
6+
7+
test_expect_success "current dir is writable" '
8+
echo "It works!" >test.txt
9+
'
10+
11+
test_expect_success "multihash is available" '
12+
type multihash
13+
'
14+
15+
test_expect_success "'multihash --help' looks good" '
16+
multihash --help >actual 2>&1 || true &&
17+
egrep -i "usage" actual >/dev/null
18+
'
19+
20+
for opt in algorithm check encoding length quiet help
21+
do
22+
test_expect_success "'multihash --help' mention -$opt option" '
23+
egrep "[-]$opt" actual >/dev/null
24+
'
25+
done
26+
27+
test_expect_success "'multihash test.txt' works" '
28+
multihash test.txt >actual
29+
'
30+
31+
test_expect_success "'multihash test.txt' output looks good" '
32+
echo "QmTwovvskpD1hzuJA8wLA73wjxSisrVknKeNvGZVyjDguU" >expected &&
33+
test_cmp expected actual
34+
'
35+
36+
test_done
37+
38+
# vi: set ft=sh :

0 commit comments

Comments
 (0)