File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments