diff options
Diffstat (limited to 'tpl/inflect')
-rw-r--r-- | tpl/inflect/inflect_test.go | 14 | ||||
-rw-r--r-- | tpl/inflect/init_test.go | 9 |
2 files changed, 12 insertions, 11 deletions
diff --git a/tpl/inflect/inflect_test.go b/tpl/inflect/inflect_test.go index a94a20218..609d4a470 100644 --- a/tpl/inflect/inflect_test.go +++ b/tpl/inflect/inflect_test.go @@ -1,19 +1,18 @@ package inflect import ( - "fmt" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + qt "github.com/frankban/quicktest" ) func TestInflect(t *testing.T) { t.Parallel() + c := qt.New(t) ns := New() - for i, test := range []struct { + for _, test := range []struct { fn func(i interface{}) (string, error) in interface{} expect interface{} @@ -34,16 +33,15 @@ func TestInflect(t *testing.T) { {ns.Singularize, "", ""}, {ns.Singularize, t, false}, } { - errMsg := fmt.Sprintf("[%d] %v", i, test) result, err := test.fn(test.in) if b, ok := test.expect.(bool); ok && !b { - require.Error(t, err, errMsg) + c.Assert(err, qt.Not(qt.IsNil)) continue } - require.NoError(t, err, errMsg) - assert.Equal(t, test.expect, result, errMsg) + c.Assert(err, qt.IsNil) + c.Assert(result, qt.Equals, test.expect) } } diff --git a/tpl/inflect/init_test.go b/tpl/inflect/init_test.go index cbcd312c7..322813b5f 100644 --- a/tpl/inflect/init_test.go +++ b/tpl/inflect/init_test.go @@ -16,12 +16,15 @@ package inflect import ( "testing" + "github.com/gohugoio/hugo/htesting/hqt" + + qt "github.com/frankban/quicktest" "github.com/gohugoio/hugo/deps" "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 @@ -33,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{}) } |