Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'common/hugo/hugo_test.go')
-rw-r--r--common/hugo/hugo_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/hugo/hugo_test.go b/common/hugo/hugo_test.go
index ff36cab7c..3bc95684b 100644
--- a/common/hugo/hugo_test.go
+++ b/common/hugo/hugo_test.go
@@ -27,8 +27,12 @@ func TestHugoInfo(t *testing.T) {
c.Assert(hugoInfo.Version(), qt.Equals, CurrentVersion.Version())
c.Assert(fmt.Sprintf("%T", VersionString("")), qt.Equals, fmt.Sprintf("%T", hugoInfo.Version()))
- c.Assert(hugoInfo.CommitHash, qt.Equals, commitHash)
- c.Assert(hugoInfo.BuildDate, qt.Equals, buildDate)
+
+ bi := getBuildInfo()
+ if bi != nil {
+ c.Assert(hugoInfo.CommitHash, qt.Equals, bi.Revision)
+ c.Assert(hugoInfo.BuildDate, qt.Equals, bi.RevisionTime)
+ }
c.Assert(hugoInfo.Environment, qt.Equals, "production")
c.Assert(string(hugoInfo.Generator()), qt.Contains, fmt.Sprintf("Hugo %s", hugoInfo.Version()))
c.Assert(hugoInfo.IsProduction(), qt.Equals, true)