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