MCPcopy
hub / github.com/kopia/kopia / TestTotalFilesDelta

Function TestTotalFilesDelta

notification/notifydata/multi_snapshot_status_test.go:364–439  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

362}
363
364func TestTotalFilesDelta(t *testing.T) {
365 tests := []struct {
366 name string
367 manifest notifydata.ManifestWithError
368 expected int64
369 }{
370 {
371 name: "no previous manifest",
372 manifest: notifydata.ManifestWithError{
373 Manifest: snapshot.Manifest{
374 RootEntry: &snapshot.DirEntry{
375 DirSummary: &fs.DirectorySummary{
376 TotalFileCount: 10,
377 },
378 },
379 },
380 },
381 expected: 0,
382 },
383 {
384 name: "no root entry in current manifest",
385 manifest: notifydata.ManifestWithError{
386 Previous: &snapshot.Manifest{
387 RootEntry: &snapshot.DirEntry{
388 DirSummary: &fs.DirectorySummary{
389 TotalFileCount: 10,
390 },
391 },
392 },
393 },
394 expected: 0,
395 },
396 {
397 name: "no dir summary in current manifest",
398 manifest: notifydata.ManifestWithError{
399 Manifest: snapshot.Manifest{
400 RootEntry: &snapshot.DirEntry{},
401 },
402 Previous: &snapshot.Manifest{
403 RootEntry: &snapshot.DirEntry{
404 DirSummary: &fs.DirectorySummary{
405 TotalFileCount: 10,
406 },
407 },
408 },
409 },
410 expected: 1,
411 },
412 {
413 name: "dir summary in both manifests",
414 manifest: notifydata.ManifestWithError{
415 Manifest: snapshot.Manifest{
416 RootEntry: &snapshot.DirEntry{
417 DirSummary: &fs.DirectorySummary{
418 TotalFileCount: 15,
419 },
420 },
421 },

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
TotalFilesDeltaMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected