discarded host handler
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m29s

This commit is contained in:
matst80
2024-11-14 18:52:51 +01:00
parent d9563460f7
commit 0fe6cb0920
3 changed files with 117 additions and 26 deletions

17
discarded-host_test.go Normal file
View File

@@ -0,0 +1,17 @@
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")
}
}