MCPcopy
hub / github.com/WireGuard/wireguard-go / ensureEOFOnClose

Function ensureEOFOnClose

ipc/namedpipe/namedpipe_test.go:308–318  ·  view source on GitHub ↗
(t *testing.T, r io.Reader, w io.Closer)

Source from the content-addressed store, hash-verified

306}
307
308func ensureEOFOnClose(t *testing.T, r io.Reader, w io.Closer) {
309 b := make([]byte, 10)
310 w.Close()
311 n, err := r.Read(b)
312 if n > 0 {
313 t.Errorf("unexpected byte count %d", n)
314 }
315 if err != io.EOF {
316 t.Errorf("expected EOF: %v", err)
317 }
318}
319
320func TestCloseClientEOFServer(t *testing.T) {
321 c, s, err := getConnection(nil)

Callers 2

TestCloseClientEOFServerFunction · 0.85
TestCloseServerEOFClientFunction · 0.85

Calls 2

CloseMethod · 0.65
ReadMethod · 0.65

Tested by

no test coverage detected