mirror of
https://github.com/jwetzell/artnet-go.git
synced 2026-08-11 10:03:41 +00:00
31 lines
586 B
Go
31 lines
586 B
Go
package artnet_test
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/jwetzell/artnet-go"
|
|
)
|
|
|
|
func TestGoodArtSyncUnmarshal(t *testing.T) {
|
|
tests := []struct {
|
|
Name string
|
|
Data []byte
|
|
Expected *artnet.ArtSync
|
|
}{}
|
|
|
|
for _, test := range tests {
|
|
t.Run(test.Name, func(t *testing.T) {
|
|
got := &artnet.ArtSync{}
|
|
|
|
err := got.UnmarshalBinary(test.Data)
|
|
if err != nil {
|
|
t.Fatalf("failed to Unmarshal ArtSync: %s", err)
|
|
}
|
|
if !reflect.DeepEqual(got, test.Expected) {
|
|
t.Fatalf("ArtSync does not match got: %+v expected: %+v", got, test.Expected)
|
|
}
|
|
})
|
|
}
|
|
}
|