Skip to content

Commit 2dbf26a

Browse files
committed
sharness: add t0020-sha1.sh
1 parent 416e75e commit 2dbf26a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/sharness/t0020-sha1.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2015 Christian Couder
4+
# MIT Licensed; see the LICENSE file in this repository.
5+
#
6+
7+
test_description="sha1 tests"
8+
9+
. ./lib/sharness/sharness.sh
10+
11+
test_expect_success "setup sha1 tests" '
12+
echo "Hash me!" >hash_me.txt &&
13+
SHA1=bc6f2c3cd945bc754789e50b2f68deee2f421810 &&
14+
echo "1114$SHA1" >expected
15+
'
16+
17+
test_expect_success "'multihash -a=sha1 -e=hex' works" '
18+
multihash -a=sha1 -e=hex hash_me.txt >actual
19+
'
20+
21+
test_expect_success "'multihash -a=sha1 -e=hex' output looks good" '
22+
test_cmp expected actual
23+
'
24+
25+
test_expect_success SHASUM "check hash using shasum" '
26+
echo "$SHA1 hash_me.txt" >expected &&
27+
$SHASUMBIN hash_me.txt >actual &&
28+
test_cmp expected actual
29+
'
30+
31+
test_done

0 commit comments

Comments
 (0)