mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
tpl: Avoid repeating the same test case in TestMD5 and TesSHA*
This commit is contained in:
parent
2236056672
commit
5b1eee44c6
1 changed files with 12 additions and 12 deletions
|
@ -2535,12 +2535,12 @@ func TestMD5(t *testing.T) {
|
|||
if result != this.expectedHash {
|
||||
t.Errorf("[%d] md5: expected '%s', got '%s'", i, this.expectedHash, result)
|
||||
}
|
||||
}
|
||||
|
||||
_, err = md5(t)
|
||||
_, err := md5(t)
|
||||
if err == nil {
|
||||
t.Error("Expected error from md5")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSHA1(t *testing.T) {
|
||||
|
@ -2559,12 +2559,12 @@ func TestSHA1(t *testing.T) {
|
|||
if result != this.expectedHash {
|
||||
t.Errorf("[%d] sha1: expected '%s', got '%s'", i, this.expectedHash, result)
|
||||
}
|
||||
}
|
||||
|
||||
_, err = sha1(t)
|
||||
_, err := sha1(t)
|
||||
if err == nil {
|
||||
t.Error("Expected error from sha1")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSHA256(t *testing.T) {
|
||||
|
@ -2583,12 +2583,12 @@ func TestSHA256(t *testing.T) {
|
|||
if result != this.expectedHash {
|
||||
t.Errorf("[%d] sha256: expected '%s', got '%s'", i, this.expectedHash, result)
|
||||
}
|
||||
}
|
||||
|
||||
_, err = sha256(t)
|
||||
_, err := sha256(t)
|
||||
if err == nil {
|
||||
t.Error("Expected error from sha256")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadFile(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue