MCPcopy
hub / github.com/kopia/kopia / verifyJSONLogFormat

Function verifyJSONLogFormat

internal/logfile/logfile_test.go:260–273  ·  view source on GitHub ↗
(t *testing.T, fname string)

Source from the content-addressed store, hash-verified

258}
259
260func verifyJSONLogFormat(t *testing.T, fname string) {
261 t.Helper()
262
263 f, err := os.Open(fname)
264 require.NoError(t, err)
265
266 defer f.Close()
267
268 s := bufio.NewScanner(f)
269
270 for s.Scan() {
271 require.True(t, json.Valid(s.Bytes()), "log line is not valid JSON: %q", s.Text())
272 }
273}

Callers 1

TestLoggingFlagsFunction · 0.85

Calls 4

HelperMethod · 0.80
OpenMethod · 0.65
CloseMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected