(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestStats(t *testing.T) { |
| 12 | d := mockfs.NewDirectory() |
| 13 | f := d.AddFile("foo", []byte{'b', 'a', 'r', 'b', 'a', 'z'}, 0) |
| 14 | tcs := []struct { |
| 15 | entry fs.Entry |
| 16 | want snapshot.Stats |
| 17 | }{ |
| 18 | { |
| 19 | entry: d, |
| 20 | want: snapshot.Stats{ |
| 21 | ExcludedDirCount: 1, |
| 22 | }, |
| 23 | }, |
| 24 | { |
| 25 | entry: f, |
| 26 | want: snapshot.Stats{ |
| 27 | ExcludedFileCount: 1, |
| 28 | ExcludedTotalFileSize: f.Size(), |
| 29 | }, |
| 30 | }, |
| 31 | } |
| 32 | |
| 33 | for _, tc := range tcs { |
| 34 | got := snapshot.Stats{} |
| 35 | got.AddExcluded(tc.entry) |
| 36 | |
| 37 | if got != tc.want { |
| 38 | t.Errorf("Stats do not match, got: %#v, want %#v", got, tc.want) |
| 39 | } |
| 40 | } |
| 41 | } |
nothing calls this directly
no test coverage detected