mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-04 13:36:35 +02:00
15 lines
310 B
Go
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")
|
|
}
|
|
}
|