From bec4826f2c9122a09bc2e80dc42a173cdde4af60 Mon Sep 17 00:00:00 2001 From: Gwyn Date: Sun, 30 Jun 2024 09:33:13 -0600 Subject: [PATCH] Test was breaking because the granularity of the sort is 1d, and the staging data was less than that. --- andrew_server_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/andrew_server_test.go b/andrew_server_test.go index 3bb4449..304477c 100644 --- a/andrew_server_test.go +++ b/andrew_server_test.go @@ -486,8 +486,6 @@ func TestArticlesOrderInAndrewTableOfContentsIsOverridable(t *testing.T) { contentRoot := t.TempDir() - // fstest.MapFS does not enforce file permissions, so we need a real file system in this test. - // above might be wrong err := os.WriteFile(contentRoot+"/index.html", []byte("{{.AndrewTableOfContents}}"), 0o700) if err != nil { t.Fatal(err) @@ -506,9 +504,7 @@ func TestArticlesOrderInAndrewTableOfContentsIsOverridable(t *testing.T) { now := time.Now() newest := now.Add(24 * time.Hour) - formattedDate := newest.Format("2006-01-02") - - content := fmt.Sprintf(``, formattedDate) + content := fmt.Sprintf(``, newest.Format("2006-01-02")) err = os.WriteFile(contentRoot+"/b_newest.html", []byte(content), 0o700) if err != nil {