package main import ( "testing" "time" ) func TestDiscardedHost(t *testing.T) { dh := NewDiscardedHostHandler(func(host string) { t.Log(host) }, 8080) dh.AppendHost("localhost") time.Sleep(2 * time.Second) if dh.hosts[0].Tries == 0 { t.Error("Host not tested") } }