package flog import ( "testing" "fmt" "math/rand" "time" ) func TestNewCopyingRouter(t *testing.T) { randomness := rand.New(rand.NewSource( time.Now().UTC().UnixNano() )) router := NewCopyingRouter(NewDiscardingRouter()) if nil == router { t.Errorf("After trying to create a copying router, expected it to be not nil, but was: %v", router) } lenInitialCopies := 0 for range router.Copies() { lenInitialCopies++ } if expected, actual := 0, lenInitialCopies; expected != actual { t.Errorf("After creating a copying router, expected copies to be length %d, but was actually %d,", expected, actual) } message := fmt.Sprintf("%x", randomness.Int63n(9999999999)) context := make(map[string]interface{}) limit := randomness.Int63n(30) for i:=int64(0); i