diff options
author | Bjørn Erik Pedersen <[email protected]> | 2018-11-26 10:11:22 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-12-06 14:37:25 +0100 |
commit | 831d23cb4d1ca99cdc15ed31c8ee1f981497be8f (patch) | |
tree | 8fe47b1b1b9233448297f8015ce61bbb7da13fc7 /tpl/compare/compare_test.go | |
parent | 514e18dc27ce37a0e9a231741d616cf29d50d610 (diff) | |
download | hugo-831d23cb4d1ca99cdc15ed31c8ee1f981497be8f.tar.gz hugo-831d23cb4d1ca99cdc15ed31c8ee1f981497be8f.zip |
Add tpl/site and tpl/hugo
This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc.
Fixes #5470
Fixes #5467
Fixes #5503
Diffstat (limited to 'tpl/compare/compare_test.go')
-rw-r--r-- | tpl/compare/compare_test.go | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tpl/compare/compare_test.go b/tpl/compare/compare_test.go index 61a84a629..d83680e53 100644 --- a/tpl/compare/compare_test.go +++ b/tpl/compare/compare_test.go @@ -21,8 +21,7 @@ import ( "testing" "time" - "github.com/gohugoio/hugo/helpers" - + "github.com/gohugoio/hugo/common/hugo" "github.com/spf13/cast" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -173,17 +172,17 @@ func doTestCompare(t *testing.T, tp tstCompareType, funcUnderTest func(a, b inte {tstEqerType1("a"), tstEqerType2("a"), 0}, {tstEqerType2("a"), tstEqerType1("a"), 0}, {tstEqerType2("a"), tstEqerType1("b"), -1}, - {helpers.MustParseHugoVersion("0.32.1").Version(), helpers.MustParseHugoVersion("0.32").Version(), 1}, - {helpers.MustParseHugoVersion("0.35").Version(), helpers.MustParseHugoVersion("0.32").Version(), 1}, - {helpers.MustParseHugoVersion("0.36").Version(), helpers.MustParseHugoVersion("0.36").Version(), 0}, - {helpers.MustParseHugoVersion("0.32").Version(), helpers.MustParseHugoVersion("0.36").Version(), -1}, - {helpers.MustParseHugoVersion("0.32").Version(), "0.36", -1}, - {"0.36", helpers.MustParseHugoVersion("0.32").Version(), 1}, - {"0.36", helpers.MustParseHugoVersion("0.36").Version(), 0}, - {"0.37", helpers.MustParseHugoVersion("0.37-DEV").Version(), 1}, - {"0.37-DEV", helpers.MustParseHugoVersion("0.37").Version(), -1}, - {"0.36", helpers.MustParseHugoVersion("0.37-DEV").Version(), -1}, - {"0.37-DEV", helpers.MustParseHugoVersion("0.37-DEV").Version(), 0}, + {hugo.MustParseVersion("0.32.1").Version(), hugo.MustParseVersion("0.32").Version(), 1}, + {hugo.MustParseVersion("0.35").Version(), hugo.MustParseVersion("0.32").Version(), 1}, + {hugo.MustParseVersion("0.36").Version(), hugo.MustParseVersion("0.36").Version(), 0}, + {hugo.MustParseVersion("0.32").Version(), hugo.MustParseVersion("0.36").Version(), -1}, + {hugo.MustParseVersion("0.32").Version(), "0.36", -1}, + {"0.36", hugo.MustParseVersion("0.32").Version(), 1}, + {"0.36", hugo.MustParseVersion("0.36").Version(), 0}, + {"0.37", hugo.MustParseVersion("0.37-DEV").Version(), 1}, + {"0.37-DEV", hugo.MustParseVersion("0.37").Version(), -1}, + {"0.36", hugo.MustParseVersion("0.37-DEV").Version(), -1}, + {"0.37-DEV", hugo.MustParseVersion("0.37-DEV").Version(), 0}, } { result := funcUnderTest(test.left, test.right) success := false |