mirror of
https://github.com/taigrr/go-fastping
synced 2025-01-18 05:03:15 -08:00
Fixed RunLoop test in the same way as an example
This commit is contained in:
parent
e5a0822b78
commit
5d1967e357
@ -180,13 +180,17 @@ func TestRunLoop(t *testing.T) {
|
||||
wait := make(chan bool)
|
||||
quit, errch := p.RunLoop()
|
||||
ticker := time.NewTicker(time.Millisecond * 250)
|
||||
loop:
|
||||
for {
|
||||
select {
|
||||
case err := <-errch:
|
||||
t.Fatalf("Pinger returns error %v", err)
|
||||
case <-ticker.C:
|
||||
ticker.Stop()
|
||||
quit <- wait
|
||||
case <-wait:
|
||||
break
|
||||
break loop
|
||||
}
|
||||
}
|
||||
|
||||
if recvCount < 2 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user