Esempio n. 1
0
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
}
Esempio n. 2
0
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"))
	}

}