feat(netxlite): introduce null dialers (#489)
See https://github.com/ooni/probe/issues/1591
This commit is contained in:
parent
f2e3e5cc08
commit
26360f5a29
4 changed files with 64 additions and 0 deletions
|
|
@ -462,3 +462,15 @@ func TestDialerErrWrapperConn(t *testing.T) {
|
|||
})
|
||||
})
|
||||
}
|
||||
|
||||
func TestNewNullDialer(t *testing.T) {
|
||||
dialer := NewNullDialer()
|
||||
conn, err := dialer.DialContext(context.Background(), "", "")
|
||||
if !errors.Is(err, ErrNoDialer) {
|
||||
t.Fatal("unexpected err", err)
|
||||
}
|
||||
if conn != nil {
|
||||
t.Fatal("expected nil conn")
|
||||
}
|
||||
dialer.CloseIdleConnections() // does not crash
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue