mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 13:25:40 +00:00
add more error case tests to osc.message.decode
This commit is contained in:
@@ -86,10 +86,20 @@ func TestBadOSCMessageDecode(t *testing.T) {
|
|||||||
errorString string
|
errorString string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "non byte slice message input",
|
name: "non []byte payload",
|
||||||
payload: "test",
|
payload: "test",
|
||||||
errorString: "osc.message.decode processor only accepts a []byte payload",
|
errorString: "osc.message.decode processor only accepts a []byte payload",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "empty []byte payload",
|
||||||
|
payload: []byte{},
|
||||||
|
errorString: "osc.message.decode processor can't work on empty []byte",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "wrong start byte in payload",
|
||||||
|
payload: []byte{48, 116, 101, 115, 116, 0, 0, 0, 44, 105, 0, 0, 0, 0, 0, 42},
|
||||||
|
errorString: "osc.message.decode processor needs an OSC looking []byte",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user