(t *testing.T)
| 3596 | } |
| 3597 | |
| 3598 | func TestAddFolderCompletion(t *testing.T) { |
| 3599 | // Empty folders are always 100% complete. |
| 3600 | comp := newFolderCompletion(db.Counts{}, db.Counts{}, 0, remoteFolderValid) |
| 3601 | comp.add(newFolderCompletion(db.Counts{}, db.Counts{}, 0, remoteFolderPaused)) |
| 3602 | if comp.CompletionPct != 100 { |
| 3603 | t.Error(comp.CompletionPct) |
| 3604 | } |
| 3605 | |
| 3606 | // Completion is of the whole |
| 3607 | comp = newFolderCompletion(db.Counts{Bytes: 100}, db.Counts{}, 0, remoteFolderValid) // 100% complete |
| 3608 | comp.add(newFolderCompletion(db.Counts{Bytes: 400}, db.Counts{Bytes: 50}, 0, remoteFolderValid)) // 82.5% complete |
| 3609 | if comp.CompletionPct != 90 { // 100 * (1 - 50/500) |
| 3610 | t.Error(comp.CompletionPct) |
| 3611 | } |
| 3612 | } |
| 3613 | |
| 3614 | func TestScanDeletedROChangedOnSR(t *testing.T) { |
| 3615 | m, conn, fcfg := setupModelWithConnection(t) |
nothing calls this directly
no test coverage detected