From a33be546fd4d70a2d7c66584b5a6a95a38d6bc98 Mon Sep 17 00:00:00 2001 From: Alberto Donato Date: Tue, 25 Jun 2024 08:52:47 +0200 Subject: [PATCH] fix tests --- server/handlers_test.go | 8 ++++---- server/template_test.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/handlers_test.go b/server/handlers_test.go index 2d9021a..aa8fbc8 100644 --- a/server/handlers_test.go +++ b/server/handlers_test.go @@ -64,9 +64,9 @@ func (s *FileHandlerTestSuite) TestListingHTML() { s.Equal(http.StatusOK, response.StatusCode) s.Equal("text/html; charset=utf-8", response.Header.Get("Content-Type")) content := w.Body.String() - s.Contains(content, `bar`) - s.Contains(content, `baz/`) - s.Contains(content, `foo`) + s.Contains(content, `bar`) + s.Contains(content, `baz/`) + s.Contains(content, `foo`) // The root directory doesn't contain a link up s.NotContains(content, `..`) } @@ -92,7 +92,7 @@ func (s *FileHandlerTestSuite) TestListingHTMLSubdir() { s.Equal(http.StatusOK, response.StatusCode) s.Equal("text/html; charset=utf-8", response.Header.Get("Content-Type")) content := w.Body.String() - s.Contains(content, `..`) + s.Contains(content, `..`) } // File content is served. diff --git a/server/template_test.go b/server/template_test.go index f1372f1..bb56e06 100644 --- a/server/template_test.go +++ b/server/template_test.go @@ -46,9 +46,9 @@ func (s *DirectoryListingTemplateTestSuite) TestRenderHTML() { s.Equal(http.StatusOK, response.StatusCode) s.Equal("text/html; charset=utf-8", response.Header.Get("Content-Type")) content := w.Body.String() - s.Contains(content, `bar`) - s.Contains(content, `baz/`) - s.Contains(content, `foo`) + s.Contains(content, `bar`) + s.Contains(content, `baz/`) + s.Contains(content, `foo`) } // RenderHTML renders the HTML template with the correct path prefix.