MCPcopy Create free account
hub / github.com/AdRoll/baker / Test_isInColdCache

Function Test_isInColdCache

pkg/buffercache/cache_test.go:33–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func Test_isInColdCache(t *testing.T) {
34 tests := []struct {
35 name string
36 loc location
37 want bool
38 }{
39 {"all zeroes", 0b00000000000000000000000000000000, true},
40 {"leading one", 0b10000000000000000000000000000000, false},
41 {"all ones", 0b11111111111111111111111111111111, false},
42 {"all ones but first", 0b01111111111111111111111111111111, true},
43 {"all zeros with less specified bits", 0b0, true},
44 {"trailing one", 0b1, true},
45 }
46 for _, tt := range tests {
47 t.Run(tt.name, func(t *testing.T) {
48 if tt.loc.isCold() != tt.want {
49 t.Errorf("got loc.isCold() = %t, want %t", tt.loc.isCold(), tt.want)
50 }
51 })
52 }
53}
54
55func TestBufferCache_PutAndFlushCompressed(t *testing.T) {
56 flushed := false

Callers

nothing calls this directly

Calls 2

isColdMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected