my computer is about to die!!!
This commit is contained in:
1 parent
d863dc3bd1
commit
e80f2601ab
13 files changed
+244
-11
No files matched your search
+18
-2
@@ -14,8 +14,6 @@ import (
|
||||
"github.com/didiercrunch/filou/helper"
|
||||
)
|
||||
|
||||
var __ = ioutil.Discard
|
||||
|
||||
func TestUnsupportedHash(t *testing.T) {
|
||||
unsupportedHashes := []Hash{"md5"}
|
||||
for _, h := range unsupportedHashes {
|
||||
@@ -77,3 +75,21 @@ func TestHashOnTheWay(t *testing.T) {
|
||||
t.Error("bad hash\nexpected: ", expectedHash, "\nreceived:", outputHash)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetHashByHashNameForAcceptedHashFunctions(t *testing.T) {
|
||||
acceptedHashFunctions := []string{"sha512"}
|
||||
for _, h := range acceptedHashFunctions {
|
||||
if _, err := GetHashByHashName(h); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetHashByHashNameForNotAcceptedHashFunctions(t *testing.T) {
|
||||
unaccepterHashFunctions := []string{"md5"}
|
||||
for _, h := range unaccepterHashFunctions {
|
||||
if _, err := GetHashByHashName(h); err == nil {
|
||||
t.Error("should never accept hash function " + h)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user