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

Function TestMakeLogDir

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

Source from the content-addressed store, hash-verified

92}
93
94func TestMakeLogDir(t *testing.T) {
95 currentTime = fakeTime
96 dir := time.Now().Format("TestMakeLogDir" + backupTimeFormat)
97 dir = filepath.Join(os.TempDir(), dir)
98 defer os.RemoveAll(dir)
99 filename := logFile(dir)
100 l := &Logger{
101 Filename: filename,
102 }
103 defer l.Close()
104 b := []byte("boo!")
105 n, err := l.Write(b)
106 isNil(err, t)
107 equals(len(b), n, t)
108 existsWithContent(logFile(dir), b, t)
109 fileCount(dir, 1, t)
110}
111
112func TestDefaultFilename(t *testing.T) {
113 currentTime = fakeTime

Callers

nothing calls this directly

Calls 7

CloseMethod · 0.95
WriteMethod · 0.95
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…