mirror of
https://github.com/jwetzell/artnet-go.git
synced 2026-08-21 06:38:59 +00:00
add test boilerplate
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package artnet_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/jwetzell/artnet-go"
|
||||
)
|
||||
|
||||
func TestGoodArtCommandUnmarshal(t *testing.T) {
|
||||
tests := []struct {
|
||||
Name string
|
||||
Data []byte
|
||||
Expected *artnet.ArtCommand
|
||||
}{}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.Name, func(t *testing.T) {
|
||||
got := &artnet.ArtCommand{}
|
||||
|
||||
err := got.UnmarshalBinary(test.Data)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to Unmarshal ArtCommand: %s", err)
|
||||
}
|
||||
if !reflect.DeepEqual(got, test.Expected) {
|
||||
t.Fatalf("ArtCommand does not match got: %+v expected: %+v", got, test.Expected)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user