MCPcopy
hub / github.com/natefinch/lumberjack / TestNewFile

Function TestNewFile

lumberjack_test.go:30–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestNewFile(t *testing.T) {
31 currentTime = fakeTime
32
33 dir := makeTempDir("TestNewFile", t)
34 defer os.RemoveAll(dir)
35 l := &Logger{
36 Filename: logFile(dir),
37 }
38 defer l.Close()
39 b := []byte("boo!")
40 n, err := l.Write(b)
41 isNil(err, t)
42 equals(len(b), n, t)
43 existsWithContent(logFile(dir), b, t)
44 fileCount(dir, 1, t)
45}
46
47func TestOpenExisting(t *testing.T) {
48 currentTime = fakeTime

Callers

nothing calls this directly

Calls 8

CloseMethod · 0.95
WriteMethod · 0.95
makeTempDirFunction · 0.85
logFileFunction · 0.85
isNilFunction · 0.85
equalsFunction · 0.85
existsWithContentFunction · 0.85
fileCountFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…