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

Function existsWithContent

lumberjack_test.go:721–729  ·  view source on GitHub ↗

existsWithContent checks that the given file exists and has the correct content.

(path string, content []byte, t testing.TB)

Source from the content-addressed store, hash-verified

719
720// existsWithContent checks that the given file exists and has the correct content.
721func existsWithContent(path string, content []byte, t testing.TB) {
722 info, err := os.Stat(path)
723 isNilUp(err, t, 1)
724 equalsUp(int64(len(content)), info.Size(), t, 1)
725
726 b, err := ioutil.ReadFile(path)
727 isNilUp(err, t, 1)
728 equalsUp(content, b, t, 1)
729}
730
731// logFile returns the log file name in the given directory for the current fake
732// time.

Callers 12

TestNewFileFunction · 0.85
TestOpenExistingFunction · 0.85
TestMakeLogDirFunction · 0.85
TestDefaultFilenameFunction · 0.85
TestAutoRotateFunction · 0.85
TestFirstWriteRotateFunction · 0.85
TestMaxBackupsFunction · 0.85
TestMaxAgeFunction · 0.85
TestLocalTimeFunction · 0.85
TestRotateFunction · 0.85
TestCompressOnRotateFunction · 0.85
TestCompressOnResumeFunction · 0.85

Calls 3

isNilUpFunction · 0.85
equalsUpFunction · 0.85
StatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…