mirror of
https://github.com/jwetzell/artnet-go.git
synced 2026-08-20 06:08:59 +00:00
switch tests to use cmp.Diff
This commit is contained in:
+5
-3
@@ -1,9 +1,10 @@
|
||||
package artnet_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/jwetzell/artnet-go"
|
||||
)
|
||||
|
||||
@@ -44,8 +45,9 @@ func TestGoodArtIpProgUnmarshal(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("failed to Unmarshal ArtIpProg: %s", err)
|
||||
}
|
||||
if !reflect.DeepEqual(got, test.Expected) {
|
||||
t.Fatalf("ArtIpProg does not match got: %+v expected: %+v", got, test.Expected)
|
||||
diff := cmp.Diff(test.Expected, got, cmpopts.IgnoreUnexported(artnet.ArtIpProg{}))
|
||||
if diff != "" {
|
||||
t.Fatalf("ArtIpProg does not match\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user