func randStrs(count int) []string { b := make([]string, count) for i := 0; i < count; i++ { b[i] = randutil.AlphaString(randutil.IntRange(10, 20)) } return b }
func TestMarshalTagTooBig(t *testing.T) { e := NewEvent() e.Tags.Set("host", randutil.AlphaString(300)) buff, err := e.MarshalBinary() if err != nil { t.Fatal(err) } ne := NewEvent() err = ne.UnmarshalBinary(buff) if err != nil { t.Fatal(err) } if len(ne.Tags.Get("host")) != 255 { t.Fatal(ne.Tags.Get("host")) } }