feat: use testify assert
parent
080796c15c
commit
2c9a60c42f
2
go.mod
2
go.mod
|
@ -6,7 +6,7 @@ require (
|
|||
github.com/Microsoft/go-winio v0.4.15 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
|
||||
github.com/go-git/go-git/v5 v5.2.0
|
||||
github.com/google/go-cmp v0.5.4
|
||||
github.com/google/go-cmp v0.5.4 // indirect
|
||||
github.com/imdario/mergo v0.3.11 // indirect
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
|
|
1
go.sum
1
go.sum
|
@ -139,6 +139,7 @@ gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
|
|||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
package comparision
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
)
|
||||
|
||||
func Diff(t *testing.T, want, got interface{}) {
|
||||
if diff := cmp.Diff(want, got); diff != "" {
|
||||
t.Errorf("mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
}
|
|
@ -3,9 +3,9 @@ package convention
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/haunt98/changeloguru/pkg/comparision"
|
||||
"github.com/haunt98/changeloguru/pkg/git"
|
||||
"github.com/sebdah/goldie/v2"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNewCommit(t *testing.T) {
|
||||
|
@ -39,7 +39,7 @@ func TestNewCommit(t *testing.T) {
|
|||
g := goldie.New(t)
|
||||
|
||||
gotResult, gotErr := NewCommit(tc.c)
|
||||
comparision.Diff(t, tc.wantErr, gotErr)
|
||||
assert.Equal(t, tc.wantErr, gotErr)
|
||||
if tc.wantErr != nil {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package markdown
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/haunt98/changeloguru/pkg/comparision"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestHeaderToString(t *testing.T) {
|
||||
|
@ -33,7 +33,7 @@ func TestHeaderToString(t *testing.T) {
|
|||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
got := tc.header.ToString()
|
||||
comparision.Diff(t, tc.want, got)
|
||||
assert.Equal(t, tc.want, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ func TestListItemToString(t *testing.T) {
|
|||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
got := tc.listItem.ToString()
|
||||
comparision.Diff(t, tc.want, got)
|
||||
assert.Equal(t, tc.want, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue