diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-08-10 21:05:17 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-08-12 13:26:32 +0200 |
commit | 9e571827055dedb46b78c5db3d17d6913f14870b (patch) | |
tree | f5f0108afe0c9385ff6dc27664943d9f719f57ad /tpl/reflect | |
parent | 6027ee11082d0b9d72de1d4d1980a702be294ad2 (diff) | |
download | hugo-9e571827055dedb46b78c5db3d17d6913f14870b.tar.gz hugo-9e571827055dedb46b78c5db3d17d6913f14870b.zip |
tests: Convert from testify to quicktest
Diffstat (limited to 'tpl/reflect')
-rw-r--r-- | tpl/reflect/init_test.go | 8 | ||||
-rw-r--r-- | tpl/reflect/reflect_test.go | 15 |
2 files changed, 12 insertions, 11 deletions
diff --git a/tpl/reflect/init_test.go b/tpl/reflect/init_test.go index 4357200ab..c0247b045 100644 --- a/tpl/reflect/init_test.go +++ b/tpl/reflect/init_test.go @@ -16,13 +16,15 @@ package reflect import ( "testing" + qt "github.com/frankban/quicktest" "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/deps" + "github.com/gohugoio/hugo/htesting/hqt" "github.com/gohugoio/hugo/tpl/internal" - "github.com/stretchr/testify/require" ) func TestInit(t *testing.T) { + c := qt.New(t) var found bool var ns *internal.TemplateFuncsNamespace @@ -34,6 +36,6 @@ func TestInit(t *testing.T) { } } - require.True(t, found) - require.IsType(t, &Namespace{}, ns.Context()) + c.Assert(found, qt.Equals, true) + c.Assert(ns.Context(), hqt.IsSameType, &Namespace{}) } diff --git a/tpl/reflect/reflect_test.go b/tpl/reflect/reflect_test.go index 9b2ad97a6..745360ee7 100644 --- a/tpl/reflect/reflect_test.go +++ b/tpl/reflect/reflect_test.go @@ -14,10 +14,9 @@ package reflect import ( - "fmt" "testing" - "github.com/stretchr/testify/assert" + qt "github.com/frankban/quicktest" ) var ns = New() @@ -25,7 +24,8 @@ var ns = New() type tstNoStringer struct{} func TestIsMap(t *testing.T) { - for i, test := range []struct { + c := qt.New(t) + for _, test := range []struct { v interface{} expect interface{} }{ @@ -33,14 +33,14 @@ func TestIsMap(t *testing.T) { {"foo", false}, {nil, false}, } { - errMsg := fmt.Sprintf("[%d] %v", i, test) result := ns.IsMap(test.v) - assert.Equal(t, test.expect, result, errMsg) + c.Assert(result, qt.Equals, test.expect) } } func TestIsSlice(t *testing.T) { - for i, test := range []struct { + c := qt.New(t) + for _, test := range []struct { v interface{} expect interface{} }{ @@ -48,8 +48,7 @@ func TestIsSlice(t *testing.T) { {"foo", false}, {nil, false}, } { - errMsg := fmt.Sprintf("[%d] %v", i, test) result := ns.IsSlice(test.v) - assert.Equal(t, test.expect, result, errMsg) + c.Assert(result, qt.Equals, test.expect) } } |