From a4bf6e586dcc83f6785346de10ec637c14624439 Mon Sep 17 00:00:00 2001 From: Tw Date: Thu, 29 Jun 2017 18:30:18 +0800 Subject: [PATCH] markdown: fix the real ineffectual assignments in test Signed-off-by: Tw --- caddyhttp/markdown/markdown_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/caddyhttp/markdown/markdown_test.go b/caddyhttp/markdown/markdown_test.go index e8279da9..44eb81d2 100644 --- a/caddyhttp/markdown/markdown_test.go +++ b/caddyhttp/markdown/markdown_test.go @@ -81,17 +81,14 @@ func TestMarkdown(t *testing.T) { req, err := http.NewRequest("GET", url, nil) if err != nil { t.Fatalf("Could not create HTTP request: %v", err) - return "" } rec := httptest.NewRecorder() code, err := md.ServeHTTP(rec, req) if err != nil { t.Fatal(err) - return "" } if code != http.StatusOK { t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code) - return "" } return rec.Body.String() } @@ -117,6 +114,10 @@ Welcome to A Caddy website! ` + if respBody != expectedBody { + t.Fatalf("Expected body:\n%q\ngot:\n%q", expectedBody, respBody) + } + respBody = get("/docflags/test.md") expectedBody = `Doc.var_string hello Doc.var_bool true @@ -226,11 +227,9 @@ func TestTemplateReload(t *testing.T) { code, err := md.ServeHTTP(rec, req) if err != nil { t.Fatal(err) - return "" } if code != http.StatusOK { t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code) - return "" } return rec.Body.String() }