Files
go-cart-actor/discarded-host_test.go
matst80 3f6f78c839
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m23s
more features
2024-11-14 19:33:04 +01:00

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")
}
}