mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
tests: Convert from testify to quicktest
This commit is contained in:
@@ -16,12 +16,12 @@ package config
|
||||
import (
|
||||
"testing"
|
||||
|
||||
qt "github.com/frankban/quicktest"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetStringSlicePreserveString(t *testing.T) {
|
||||
assert := require.New(t)
|
||||
c := qt.New(t)
|
||||
cfg := viper.New()
|
||||
|
||||
s := "This is a string"
|
||||
@@ -30,7 +30,7 @@ func TestGetStringSlicePreserveString(t *testing.T) {
|
||||
cfg.Set("s1", s)
|
||||
cfg.Set("s2", sSlice)
|
||||
|
||||
assert.Equal([]string{s}, GetStringSlicePreserveString(cfg, "s1"))
|
||||
assert.Equal(sSlice, GetStringSlicePreserveString(cfg, "s2"))
|
||||
assert.Nil(GetStringSlicePreserveString(cfg, "s3"))
|
||||
c.Assert(GetStringSlicePreserveString(cfg, "s1"), qt.DeepEquals, []string{s})
|
||||
c.Assert(GetStringSlicePreserveString(cfg, "s2"), qt.DeepEquals, sSlice)
|
||||
c.Assert(GetStringSlicePreserveString(cfg, "s3"), qt.IsNil)
|
||||
}
|
||||
|
Reference in New Issue
Block a user