mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
tests: Convert from testify to quicktest
This commit is contained in:
@@ -16,7 +16,7 @@ package integrity
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
qt "github.com/frankban/quicktest"
|
||||
)
|
||||
|
||||
func TestHashFromAlgo(t *testing.T) {
|
||||
@@ -33,14 +33,14 @@ func TestHashFromAlgo(t *testing.T) {
|
||||
} {
|
||||
|
||||
t.Run(algo.name, func(t *testing.T) {
|
||||
assert := require.New(t)
|
||||
c := qt.New(t)
|
||||
h, err := newHash(algo.name)
|
||||
if algo.bits > 0 {
|
||||
assert.NoError(err)
|
||||
assert.Equal(algo.bits/8, h.Size())
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(h.Size(), qt.Equals, algo.bits/8)
|
||||
} else {
|
||||
assert.Error(err)
|
||||
assert.Contains(err.Error(), "use either md5, sha256, sha384 or sha512")
|
||||
c.Assert(err, qt.Not(qt.IsNil))
|
||||
c.Assert(err.Error(), qt.Contains, "use either md5, sha256, sha384 or sha512")
|
||||
}
|
||||
|
||||
})
|
||||
|
@@ -16,24 +16,24 @@ package postcss
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
qt "github.com/frankban/quicktest"
|
||||
)
|
||||
|
||||
// Issue 6166
|
||||
func TestDecodeOptions(t *testing.T) {
|
||||
assert := require.New(t)
|
||||
c := qt.New(t)
|
||||
opts1, err := DecodeOptions(map[string]interface{}{
|
||||
"no-map": true,
|
||||
})
|
||||
|
||||
assert.NoError(err)
|
||||
assert.True(opts1.NoMap)
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(opts1.NoMap, qt.Equals, true)
|
||||
|
||||
opts2, err := DecodeOptions(map[string]interface{}{
|
||||
"noMap": true,
|
||||
})
|
||||
|
||||
assert.NoError(err)
|
||||
assert.True(opts2.NoMap)
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(opts2.NoMap, qt.Equals, true)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user