diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-04-18 10:28:54 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-04-18 19:17:27 +0200 |
commit | e66e2e9ce5f2036174ecb114b96761ad023d95a1 (patch) | |
tree | 90cf4e7a352ab12970b7851a148accd2bdd5382f /commands/server_test.go | |
parent | 5de6f8a02c3abb3145ce7985dff985e9e783e9b3 (diff) |
Revert "Revert "Fix PostProcess regression for hugo server""
This reverts commit 6c35a1a9eacf2aa86a11ecd31c4022ce330b2f16.
Updates #9794
Diffstat (limited to 'commands/server_test.go')
-rw-r--r-- | commands/server_test.go | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/commands/server_test.go b/commands/server_test.go index ea50afd94..c2aa0dfd5 100644 --- a/commands/server_test.go +++ b/commands/server_test.go @@ -31,16 +31,6 @@ import ( qt "github.com/frankban/quicktest" ) -func TestServer(t *testing.T) { - c := qt.New(t) - - r := runServerTest(c, true, "") - - c.Assert(r.err, qt.IsNil) - c.Assert(r.homeContent, qt.Contains, "List: Hugo Commands") - c.Assert(r.homeContent, qt.Contains, "Environment: development") -} - // Issue 9518 func TestServerPanicOnConfigError(t *testing.T) { c := qt.New(t) @@ -101,6 +91,42 @@ baseURL="https://example.org" } +func TestServerBugs(t *testing.T) { + c := qt.New(t) + + for _, test := range []struct { + name string + flag string + assert func(c *qt.C, r serverTestResult) + }{ + // Issue 9788 + {"PostProcess, memory", "", func(c *qt.C, r serverTestResult) { + c.Assert(r.err, qt.IsNil) + c.Assert(r.homeContent, qt.Contains, "PostProcess: /foo.min.css") + }}, + {"PostProcess, disk", "--renderToDisk", func(c *qt.C, r serverTestResult) { + c.Assert(r.err, qt.IsNil) + c.Assert(r.homeContent, qt.Contains, "PostProcess: /foo.min.css") + }}, + } { + c.Run(test.name, func(c *qt.C) { + config := ` +baseURL="https://example.org" +` + + var args []string + if test.flag != "" { + args = strings.Split(test.flag, "=") + } + r := runServerTest(c, true, config, args...) + test.assert(c, r) + + }) + + } + +} + type serverTestResult struct { err error homeContent string |