feat(netxlite): introduce null dialers (#489)

See https://github.com/ooni/probe/issues/1591
This commit is contained in:
Simone Basso 2021-09-08 14:46:17 +02:00 committed by GitHub
commit 26360f5a29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 64 additions and 0 deletions

View file

@ -536,3 +536,15 @@ func TestTLSHandshakerErrWrapper(t *testing.T) {
})
})
}
func TestNewNullTLSDialer(t *testing.T) {
dialer := NewNullTLSDialer()
conn, err := dialer.DialTLSContext(context.Background(), "", "")
if !errors.Is(err, ErrNoTLSDialer) {
t.Fatal("unexpected err", err)
}
if conn != nil {
t.Fatal("expected nil conn")
}
dialer.CloseIdleConnections() // does not crash
}