(t *testing.T)
| 43 | } |
| 44 | |
| 45 | func TestCache(t *testing.T) { |
| 46 | c := memory.NewCache(1024) |
| 47 | (&test.Blob{Contents: "foo"}).MustUpload(t, c) |
| 48 | if got, want := c.SumBlobSize(), int64(3); got != want { |
| 49 | t.Errorf("size = %d; want %d", got, want) |
| 50 | } |
| 51 | (&test.Blob{Contents: "bar"}).MustUpload(t, c) |
| 52 | if got, want := c.SumBlobSize(), int64(6); got != want { |
| 53 | t.Errorf("size = %d; want %d", got, want) |
| 54 | } |
| 55 | (&test.Blob{Contents: strings.Repeat("x", 1020)}).MustUpload(t, c) |
| 56 | if got, want := c.SumBlobSize(), int64(1023); got != want { |
| 57 | t.Errorf("size = %d; want %d", got, want) |
| 58 | } |
| 59 | (&test.Blob{Contents: "five!"}).MustUpload(t, c) |
| 60 | if got, want := c.SumBlobSize(), int64(5); got != want { |
| 61 | t.Errorf("size = %d; want %d", got, want) |
| 62 | } |
| 63 | } |
nothing calls this directly
no test coverage detected