diff --git a/addr_test.go b/addr_test.go index b7b56cd..24a9993 100644 --- a/addr_test.go +++ b/addr_test.go @@ -1,6 +1,7 @@ package stun import ( + "io" "net" "testing" ) @@ -47,6 +48,13 @@ func TestMappedAddress(t *testing.T) { t.Error("should error") } }) + t.Run("Bad length", func(t *testing.T) { + message := new(Message) + message.Add(AttrMappedAddress, []byte{1, 2, 3}) + if err := got.GetFrom(message); err != io.ErrUnexpectedEOF { + t.Errorf("<%s> should be <%s>", err, io.ErrUnexpectedEOF) + } + }) }) }) }