🚨 A bunch of small improvements from linter
This commit is contained in:
parent
480e36763f
commit
8f02956ecd
10 changed files with 51 additions and 47 deletions
|
|
@ -7,6 +7,8 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var errTest = errors.New("sorry")
|
||||
|
||||
func TestMake(t *testing.T) {
|
||||
genOpt := WithGenerator(func(*Config) (string, error) { return "abc", nil })
|
||||
testcases := []struct {
|
||||
|
|
@ -48,11 +50,10 @@ func TestMake(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMakeErr(t *testing.T) {
|
||||
retErr := errors.New("oops")
|
||||
conf := NewConfig(WithGenerator(func(*Config) (string, error) { return "foobar", retErr }))
|
||||
conf := NewConfig(WithGenerator(func(*Config) (string, error) { return "foobar", errTest }))
|
||||
st, err := Make(conf)
|
||||
assert.Zero(t, st)
|
||||
assert.ErrorIs(t, err, retErr)
|
||||
assert.ErrorIs(t, err, errTest)
|
||||
}
|
||||
|
||||
func TestMakeDoesntChangeConf(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue