hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 5b1eee44c687d89d7e3bc673edb7253a46d4612c
parent 2236056672b6904ef0aef7b2f9980957e1b3d0a5
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Mon,  5 Dec 2016 00:27:49 +0100

tpl: Avoid repeating the same test case in TestMD5 and TesSHA*

Diffstat:
Mtpl/template_funcs_test.go | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/tpl/template_funcs_test.go b/tpl/template_funcs_test.go
@@ -2535,11 +2535,11 @@ func TestMD5(t *testing.T) {
 		if result != this.expectedHash {
 			t.Errorf("[%d] md5: expected '%s', got '%s'", i, this.expectedHash, result)
 		}
+	}
 
-		_, err = md5(t)
-		if err == nil {
-			t.Error("Expected error from md5")
-		}
+	_, err := md5(t)
+	if err == nil {
+		t.Error("Expected error from md5")
 	}
 }
 
@@ -2559,11 +2559,11 @@ func TestSHA1(t *testing.T) {
 		if result != this.expectedHash {
 			t.Errorf("[%d] sha1: expected '%s', got '%s'", i, this.expectedHash, result)
 		}
+	}
 
-		_, err = sha1(t)
-		if err == nil {
-			t.Error("Expected error from sha1")
-		}
+	_, err := sha1(t)
+	if err == nil {
+		t.Error("Expected error from sha1")
 	}
 }
 
@@ -2583,11 +2583,11 @@ func TestSHA256(t *testing.T) {
 		if result != this.expectedHash {
 			t.Errorf("[%d] sha256: expected '%s', got '%s'", i, this.expectedHash, result)
 		}
+	}
 
-		_, err = sha256(t)
-		if err == nil {
-			t.Error("Expected error from sha256")
-		}
+	_, err := sha256(t)
+	if err == nil {
+		t.Error("Expected error from sha256")
 	}
 }