blob: 270a495f2bd82b34046af2c9a27387a2495636e5 [file] [log] [blame]
package tasks
import (
"context"
"net"
"testing"
"time"
)
func TestGoogle(t *testing.T) {
ctx, _ := context.WithTimeout(context.Background(), 30*time.Second)
d := NewDNSResolverTask(
"welcome.t5.lekva.me",
[]net.IP{
net.ParseIP("135.181.48.180"),
net.ParseIP("65.108.39.172"),
},
ctx,
t.Logf,
)
d.FinalizeSubtasks()
ch := make(chan struct{})
d.OnDone(func(err error) {
if err != nil {
t.Logf("%s\n", err.Error())
} else {
t.Logf("Dooone")
}
ch <- struct{}{}
})
d.Start()
<-ch
}