blob: 270a495f2bd82b34046af2c9a27387a2495636e5 [file] [log] [blame]
Giorgi Lekveishvili46743d42023-12-10 15:47:23 +04001package tasks
2
3import (
4 "context"
5 "net"
6 "testing"
7 "time"
8)
9
10func TestGoogle(t *testing.T) {
11 ctx, _ := context.WithTimeout(context.Background(), 30*time.Second)
12 d := NewDNSResolverTask(
13 "welcome.t5.lekva.me",
14 []net.IP{
15 net.ParseIP("135.181.48.180"),
16 net.ParseIP("65.108.39.172"),
17 },
18 ctx,
19 t.Logf,
20 )
21 d.FinalizeSubtasks()
22 ch := make(chan struct{})
23 d.OnDone(func(err error) {
24 if err != nil {
25 t.Logf("%s\n", err.Error())
26 } else {
27 t.Logf("Dooone")
28 }
29 ch <- struct{}{}
30 })
31 d.Start()
32 <-ch
33}