MCPcopy Create free account
hub / github.com/facebook/time / TestClientClose

Function TestClientClose

ntrip/client_test.go:259–274  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

257}
258
259func TestClientClose(t *testing.T) {
260 client, server := net.Pipe()
261 defer server.Close()
262
263 c := &Client{
264 config: Config{Caster: "localhost:2101", Mountpoint: "/M", Password: "p"},
265 conn: client,
266 logger: slog.Default(),
267 }
268
269 require.NoError(t, c.Close())
270 require.Nil(t, c.conn)
271
272 _, err := c.Write([]byte("data"))
273 require.Error(t, err)
274}
275
276func TestClientConnectDialFailure(t *testing.T) {
277 c := NewClient(Config{

Callers

nothing calls this directly

Calls 4

CloseMethod · 0.95
WriteMethod · 0.95
CloseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…