MCPcopy Index your code
hub / github.com/docker/docker-agent / TestRotatingFile_CreatesDirectory

Function TestRotatingFile_CreatesDirectory

pkg/logging/rotate_test.go:124–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestRotatingFile_CreatesDirectory(t *testing.T) {
125 t.Parallel()
126 dir := t.TempDir()
127 path := filepath.Join(dir, "subdir", "nested", "test.log")
128
129 rf, err := NewRotatingFile(path)
130 require.NoError(t, err)
131 defer rf.Close()
132
133 _, err = rf.Write([]byte("test"))
134 require.NoError(t, err)
135
136 _, err = os.Stat(path)
137 require.NoError(t, err)
138}

Callers

nothing calls this directly

Calls 3

CloseMethod · 0.95
WriteMethod · 0.95
NewRotatingFileFunction · 0.85

Tested by

no test coverage detected