mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
commands: Fix server panic regression
And now with a proper server test. Fixes #9518 Fixes #9530 Fixes #9539
This commit is contained in:
parent
4ada09415d
commit
aebde49b88
4 changed files with 45 additions and 15 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue