From da794a866e6671d45548e688271b4fc208862238 Mon Sep 17 00:00:00 2001 From: Maxime Date: Wed, 29 Jul 2015 18:00:08 +0200 Subject: [PATCH] Change date of the files in test to serve the static file and not generate a new one --- middleware/markdown/markdown_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/middleware/markdown/markdown_test.go b/middleware/markdown/markdown_test.go index d1a9b13a..1cb5301d 100644 --- a/middleware/markdown/markdown_test.go +++ b/middleware/markdown/markdown_test.go @@ -3,8 +3,10 @@ package markdown import ( "net/http" "net/http/httptest" + "os" "strings" "testing" + "time" "github.com/mholt/caddy/middleware" "github.com/russross/blackfriday" @@ -139,6 +141,10 @@ func getTrue() bool { t.Fatalf("Could not create HTTP request: %v", err) } rec = httptest.NewRecorder() + currenttime := time.Now().Local().Add(-time.Second) + err = os.Chtimes("testdata/og/first.md", currenttime, currenttime) + currenttime = time.Now().Local() + err = os.Chtimes("testdata/og_static/og/first.md/index.html", currenttime, currenttime) md.ServeHTTP(rec, req) if rec.Code != http.StatusOK {