summaryrefslogtreecommitdiffstats
path: root/hugolib/testhelpers_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-23 22:03:25 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-23 22:46:01 +0200
commit0e87b18b66d2c8ba9e2abc429630cb03f5b093d6 (patch)
tree49f58317681a67aae9f90def687e069c1f63cc3a /hugolib/testhelpers_test.go
parente98f885b8af27f5473a89d31d0b1f02e61e8a5ec (diff)
hugolib: Fix handling of zero-length files
This was a regression in Hugo 0.20. This commit makes sure that zeron-length files are not rendered to file. Fixes #3355
Diffstat (limited to 'hugolib/testhelpers_test.go')
-rw-r--r--hugolib/testhelpers_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go
index cb529204a..f82399eef 100644
--- a/hugolib/testhelpers_test.go
+++ b/hugolib/testhelpers_test.go
@@ -61,6 +61,12 @@ func (th testHelper) assertFileContentRegexp(filename string, matches ...string)
}
}
+func (th testHelper) assertFileNotExist(filename string) {
+ exists, err := helpers.Exists(filename, th.Fs.Destination)
+ require.NoError(th.T, err)
+ require.False(th.T, exists)
+}
+
func (th testHelper) replaceDefaultContentLanguageValue(value string) string {
defaultInSubDir := th.Cfg.GetBool("defaultContentLanguageInSubDir")
replace := th.Cfg.GetString("defaultContentLanguage") + "/"