diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-02-21 19:12:04 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-02-21 21:43:26 +0100 |
commit | aebde49b884c3b5ef73d8e1a01fca8a1354ac5b9 (patch) | |
tree | 299616c4bda0ffe185335bf543b327d8fb6b7068 /commands/commands_test.go | |
parent | 4ada09415dfa4c25c4fe9473fecf9e51ec740900 (diff) |
commands: Fix server panic regression
And now with a proper server test.
Fixes #9518
Fixes #9530
Fixes #9539
Diffstat (limited to 'commands/commands_test.go')
-rw-r--r-- | commands/commands_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/commands/commands_test.go b/commands/commands_test.go index b4fb89621..b89e317c2 100644 --- a/commands/commands_test.go +++ b/commands/commands_test.go @@ -329,7 +329,7 @@ type testSiteConfig struct { contentDir string } -func createSimpleTestSite(t *testing.T, cfg testSiteConfig) (string, func(), error) { +func createSimpleTestSite(t testing.TB, cfg testSiteConfig) (string, func(), error) { d, clean, e := htesting.CreateTempDir(hugofs.Os, "hugo-cli") if e != nil { return "", nil, e @@ -392,12 +392,12 @@ Environment: {{ hugo.Environment }} return d, clean, nil } -func writeFile(t *testing.T, filename, content string) { +func writeFile(t testing.TB, filename, content string) { must(t, os.MkdirAll(filepath.Dir(filename), os.FileMode(0755))) must(t, ioutil.WriteFile(filename, []byte(content), os.FileMode(0755))) } -func must(t *testing.T, err error) { +func must(t testing.TB, err error) { if err != nil { t.Fatal(err) } |