MCPcopy
hub / github.com/kopia/kopia / TestRepositoryUpgrade_checkIndexInfo

Function TestRepositoryUpgrade_checkIndexInfo

cli/command_repository_upgrade_test.go:299–430  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

297}
298
299func TestRepositoryUpgrade_checkIndexInfo(t *testing.T) {
300 tcs := []struct {
301 indexInfo0 content.Info
302 indexInfo1 content.Info
303 expectRegexs []string
304 }{
305 {
306 indexInfo0: content.Info{PackBlobID: "a"},
307 indexInfo1: content.Info{PackBlobID: "a"},
308 expectRegexs: []string{},
309 },
310 {
311 indexInfo0: content.Info{PackBlobID: "a"},
312 indexInfo1: content.Info{PackBlobID: "b"},
313 expectRegexs: []string{
314 `do not match: "a", "b".*PackBlobID`,
315 },
316 },
317 {
318 indexInfo0: content.Info{TimestampSeconds: 1},
319 indexInfo1: content.Info{TimestampSeconds: 1},
320 expectRegexs: []string{},
321 },
322 {
323 indexInfo0: content.Info{TimestampSeconds: 1},
324 indexInfo1: content.Info{TimestampSeconds: 2},
325 expectRegexs: []string{
326 "do not match.*TimestampSeconds",
327 },
328 },
329 {
330 indexInfo0: content.Info{OriginalLength: 1},
331 indexInfo1: content.Info{OriginalLength: 1},
332 expectRegexs: []string{},
333 },
334 {
335 indexInfo0: content.Info{OriginalLength: 1},
336 indexInfo1: content.Info{OriginalLength: 2},
337 expectRegexs: []string{
338 "do not match.*OriginalLength",
339 },
340 },
341 {
342 indexInfo0: content.Info{PackedLength: 1},
343 indexInfo1: content.Info{PackedLength: 1},
344 expectRegexs: []string{},
345 },
346 {
347 indexInfo0: content.Info{PackedLength: 1},
348 indexInfo1: content.Info{PackedLength: 2},
349 expectRegexs: []string{
350 "do not match.*PackedLength",
351 },
352 },
353 {
354 indexInfo0: content.Info{PackOffset: 1},
355 indexInfo1: content.Info{PackOffset: 1},
356 expectRegexs: []string{},

Callers

nothing calls this directly

Calls 3

CheckIndexInfoFunction · 0.92
RunMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected