diff options
Diffstat (limited to 'tpl/urls/urls_test.go')
-rw-r--r-- | tpl/urls/urls_test.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tpl/urls/urls_test.go b/tpl/urls/urls_test.go index 7bcef9cd5..9c005d2df 100644 --- a/tpl/urls/urls_test.go +++ b/tpl/urls/urls_test.go @@ -14,14 +14,14 @@ package urls import ( - "fmt" "net/url" "testing" + "github.com/gohugoio/hugo/htesting/hqt" + + qt "github.com/frankban/quicktest" "github.com/gohugoio/hugo/deps" "github.com/spf13/viper" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) var ns = New(&deps.Deps{Cfg: viper.New()}) @@ -30,8 +30,9 @@ type tstNoStringer struct{} func TestParse(t *testing.T) { t.Parallel() + c := qt.New(t) - for i, test := range []struct { + for _, test := range []struct { rawurl interface{} expect interface{} }{ @@ -53,16 +54,16 @@ func TestParse(t *testing.T) { // errors {tstNoStringer{}, false}, } { - errMsg := fmt.Sprintf("[%d] %v", i, test) result, err := ns.Parse(test.rawurl) 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.CmpEquals(hqt.DeepAllowUnexported(&url.URL{}, url.Userinfo{})), test.expect) } } |