Files
ctrld/internal/controld/reachability_test.go
T

15 lines
310 B
Go

package controld
import (
"context"
"testing"
)
func TestProbeReachabilityRespectsCancelledContext(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel()
if err := ProbeReachability(ctx, false); err == nil {
t.Error("expected an error for an already-cancelled context")
}
}