MCPcopy Create free account
hub / github.com/docker/cli / TestEOFWithoutError

Function TestEOFWithoutError

cli/connhelper/commandconn/commandconn_unix_test.go:37–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestEOFWithoutError(t *testing.T) {
38 ctx := context.TODO()
39 c, err := New(ctx, "sh", "-c", "echo hello; echo some debug log >&2; exit 0")
40 assert.NilError(t, err)
41 b := make([]byte, 32)
42 n, err := c.Read(b)
43 assert.Check(t, is.Equal(len("hello\n"), n))
44 assert.NilError(t, err)
45 n, err = c.Read(b)
46 assert.Check(t, is.Equal(0, n))
47 assert.Check(t, is.Equal(io.EOF, err))
48}
49
50func TestCloseRunningCommand(t *testing.T) {
51 ctx := context.TODO()

Callers

nothing calls this directly

Calls 2

NewFunction · 0.70
ReadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…